Guest User

Untitled

a guest
Jul 19th, 2025
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.99 KB | None | 0 0
  1. # Load required components
  2. loadrt or2 count=1
  3. loadrt timedelay count=1
  4. loadrt oneshot count=1
  5. loadrt limit3 count=1
  6. loadrt not count=1
  7. loadrt and2 count=1
  8. loadrt time
  9.  
  10. addf or2.0 servo-thread
  11. addf timedelay.0 servo-thread
  12. addf oneshot.0 servo-thread
  13. addf limit3.0 servo-thread
  14. addf not.0 servo-thread
  15. addf and2.0 servo-thread
  16.  
  17. # Combine axis motion signals
  18. net x-moving motion.axis.0.in-motion => or2.0.in0
  19. net y-moving motion.axis.1.in-motion => or2.0.in1
  20. net any-moving or2.0.out
  21.  
  22. # Set up a 20-second repeating pulse generator using limit3
  23. setp limit3.0.min 0
  24. setp limit3.0.max 20
  25. setp limit3.0.scale 1
  26. net runtime time.time => limit3.0.in
  27.  
  28. # Detect when 20 seconds has passed
  29. net cycle-done limit3.0.on-max => oneshot.0.trigger
  30.  
  31. # Create a 1-second pulse from the oneshot
  32. setp oneshot.0.width 1.0
  33. net pulse1s oneshot.0.out
  34.  
  35. # Combine pulse and motion condition
  36. net enable-pulse and2.0.out => parport.0.pin-05-out
  37. net pulse1s => and2.0.in0
  38. net any-moving => and2.0.in1
  39.  
Advertisement
Add Comment
Please, Sign In to add comment