Home        Store        Docs        Blog

Using Shift button of joystick in our script using pymavlink

hi there,

so here i am with a doubt again, currently i am working on pymavlink documentation provided in (“https://www.ardusub.com/developers/pymavlink.html”). So now i trying to run a script in python importing pymavlink, such that by passing cmds to swtiching on the light1 of ROV, as given in the code below,

#Light 1 bright
buttons= 1<<14
for x in range(4):
master.mav.manual_control_send(master.target_system, 0,0,0,0,buttons)
time.sleep(1)
#Light 1 dimmer
buttons = 1<<13
for x in range(4):
master.mav.manual_control_send(master.target_system, 0,0,0,0,buttons)
time.sleep(1)

these code puts my ROV to to swtich on my lights1 by 4 step (light1 brighter) and (light2 dimmer). Here the buttons value assigned are the values which uses the same as joystick functions.
Now the problem i am facing here is, when i am trying to do the same for light2 i am using a shift key of joystick. So how to use the shift key with the assigned key in the scripting. i tried like this buttons = 1<<5+1<<13,but it does not work, how to do a proper scripting to pass the double button press of the joystick, from the documentation provided in pymavlink i am trying. Anyone who is familar with this may put your help here. Your help is valuable…