HTML

accelerationExampleTwo.py

Nov 18th, 2016
176
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. from finch import Finch
  2. from random import randint
  3.  
  4. tweety = Finch()
  5.  
  6. left, right = tweety.obstacle()
  7.  
  8. while not left and not right:
  9.     x, y, z, tap, shake = tweety.acceleration()
  10.     print("X is %.2f gees, Y is %.2f gees, Z is %.2f gees, tap is %r shake is %r" % (x, y, z, tap, shake));
  11.     tweety.buzzer(0.1, (880 - int(x*770.0)));
  12.     left, right = tweety.obstacle()
  13.    
  14. tweety.close()
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment