Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from finch import Finch
- from random import randint
- tweety = Finch()
- left, right = tweety.obstacle()
- while not left and not right:
- x, y, z, tap, shake = tweety.acceleration()
- print("X is %.2f gees, Y is %.2f gees, Z is %.2f gees, tap is %r shake is %r" % (x, y, z, tap, shake));
- tweety.buzzer(0.1, (880 - int(x*770.0)));
- left, right = tweety.obstacle()
- tweety.close()
Advertisement