I have a cronjob that runs every two minutes and sets a servo. (Example from: https://learn.adafruit.com/adafruits-raspberry-pi-lesson-8-using-a-servo-motor/software)
My bash-script calculates the needed millisecond setting and ends with:
gpio -g mode 18 pwm
gpio pwm-ms
gpio pwmc 192
gpio pwmr 2000
gpio -g pwm 18 "$SERVO_MS"
- Is setting the mode everytime I run the script hazardous?
- Do I otherwise need to cleanup gpio after my script runs?