SHARE
TWEET

get_direction example (silly)

DeaD_EyE Dec 24th, 2018 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top