inputs.Hand
- class inputs.Hand(value)
Hand refers to which hand the transmitter is held by.
The below example shows how to get transmitter references for each hand and then toggles the up button on each back and forth. To see the effect, make sure to assign the up button of these transmitters to some action on the robot.
from inputs import * from time import sleep # we use the hand enums to get the transmitter # reference corresponding to the correct hand left_transmitter = TransmitterReference(Hand.LEFT) right_transmitter = TransmitterReference(Hand.RIGHT) while True: # press up on the left hand left_transmitter.press(ButtonId.UP,1) sleep(1) # release it left_transmitter.press(ButtonId.UP,0) # and press up on the right hand right_transmitter.press(ButtonId.UP,1) sleep(1) # and then release it and loop right_transmitter.press(ButtonId.UP,0)
- LEFT
- RIGHT