Last active
December 30, 2019 17:18
-
-
Save ahl/f8686793469df4479183229e24348221 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
white = digitalio.DigitalInOut(board.C1) | |
black = digitalio.DigitalInOut(board.C0) | |
black.direction = digitalio.Direction.OUTPUT | |
black.value = True | |
white.direction = digitalio.Direction.OUTPUT | |
white.value = True | |
def tap(v): | |
tnext = time.time() | |
white.value = False | |
value = True | |
for t in v: | |
tnext += t / 1000 | |
while time.time() < tnext: | |
pass | |
white.value = value | |
value = not value | |
def left(): | |
tap([17.7 + 15.7, 2, 2, 2, 4, 2, 2, 2, 2]) | |
def right(): | |
tap([17.7 + 15.7, 2, 2, 2, 4, 2, 2, 2, 4]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment