Advertisement
silver2row

Untitled

Jul 5th, 2020
1,482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | None | 0 0
  1. #!/bin/bash
  2. servo1=/sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:0/
  3.  
  4. function disable {
  5.         echo 0 > $servo1/enable
  6. }
  7.  
  8. function enable {
  9.         echo 1 > $servo1/enable
  10. }
  11.  
  12. echo "Servo attached to S1 must be running now..."
  13.  
  14. echo 10000000 > $servo1/period
  15. echo 1000000 > $servo1/duty_cycle
  16. enable
  17.  
  18. sleep 1
  19. echo 2000000 > $servo1/duty_cycle
  20. sleep 1
  21. echo 1000000 > $servo1/duty_cycle
  22. sleep 1
  23. echo 2000000 > $servo1/duty_cycle
  24. sleep 1
  25. echo 1000000 > $servo1/duty_cycle
  26. disable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement