Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import math
  2. theta = int(input("give theta:"))
  3. fudge = 11/12#;
  4. theta = -theta#
  5. maxz = 2350#; % Max pulse duration (us)
  6. minz = 850#; % Min pulse duration (us)
  7. pos = (theta%2*3.1415926)/(fudge*2*3.1415926)#; % Nomalized position (rad/2pi)
  8. pos = math.floor(pos*(maxz-minz)+minz)#; % Scaled pulse duraction (us)
  9. print('M280 P4 S'+ str(pos) +' I1')#;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement