Advertisement
Guest User

Untitled

a guest
Aug 18th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. component spooler;
  2.  
  3. pin in signed min_limit;
  4. pin in signed max_limit;
  5. pin in float vel_in;
  6. pin in signed step_counts;
  7. pin out float vel_out;
  8. variable int direction;
  9.  
  10. function _;
  11. license "GPLv2 or later";
  12. ;;
  13.  
  14. FUNCTION(_)
  15. {
  16. if(step_counts <= min_limit){direction = 0;}
  17. if(step_counts >= max_limit){direction = 1;}
  18.  
  19. if(direction) {vel_out = vel_in;}
  20. else {vel_out = -vel_in;}
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement