I wrote a python program that uses one of the Beaglebone's PWM pins to
control a servomotor. It also uses an LED output to indicate that the
program is running. The program runs fine when I tell it to run. However,
it's when I set it to automatically run at the Bone's startup that I have
problems. I use the following steps to set the script to autostart:
1. Compile the program into a python object file
~# python -m py_compile file.py
2. Add the following line to the end of the file /etc/init.d/rc.local
python /root/file.pyc
3. Restart the Beaglebone
The program does not run at the start. I am using a Beaglebone running
Debian Image 2015-11-12. Any help into this matter would be very
appreciated. Here is all the relevant python code:
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.PWM as PWM
servo = "P8_13"
out = "P8_10"
angle = 3
GPIO.setup(out,GPIO.OUT)
GPIO.output(out,GPIO.HIGH)
PWM.start(servo,0,60)
while True:
PWM.set_duty_cycle(servo,angle)
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/0a39f556-c607-4432-b090-5eb1db53ca52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.