Advertisement
Guest User

Untitled

a guest
Jan 12th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. # dwell on corners Sammel Lothar
  4. # license "GPLv2 or greater"
  5.  
  6. import hal
  7. import time
  8.  
  9. #Now we create the HAL component and its pins
  10. c = hal.component("dwelloncorners")
  11.  
  12. c.newpin("time_to_dwell",hal.HAL_FLOAT, hal.HAL_IN)
  13. c.newpin("deg",hal.HAL_FLOAT, hal.HAL_IN)
  14. c.newpin("mot",hal.HAL_FLOAT, hal.HAL_IN)
  15.  
  16. c.newpin("in", hal.HAL_FLOAT, hal.HAL_IN)
  17. c.newpin("out", hal.HAL_FLOAT, hal.HAL_OUT)
  18.  
  19. c.ready()
  20.  
  21. try:
  22. while 1:
  23. time.sleep(1)
  24. h["out"] = h["in"]
  25. except KeyboardInterrupt:
  26. raise SystemExit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement