Advertisement
DeaD_EyE

get_direction example (silly)

Dec 24th, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. def get_direction(speed):
  2.     '''
  3.    speed := speed of axis in rotation per second
  4.    
  5.    This function returns:
  6.    1  := Clockwise rotation
  7.    0  := No rotation
  8.    -1 := Counter clockwise rotation
  9.    '''
  10.     if speed > 0:
  11.         return 1
  12.     elif speed < 0:
  13.         return -1
  14.     else:
  15.         return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement