Hi,
I'm new to BeagleBone and libbulldog. I'm trying to write a simple program to control a servo.
I have the servo hooked to the 5v (P9_7) and ground (P9_1). I've tried connecting the signal to P8_13 and P9_14. If I plug the power in while the board is powered up I can hear the servo (I think) reset itself so I know it can power the servo.
If I use the
sample program, when I run it I see the servo move as expected.
However, once Java reaches the line where the servo is instantiated (
Servo servo = new TowerProMicroSG90(pwm); ) it seems to hang. The servo DOES move, but none of the corresponding System.out.println messages are printed. Also, the program never exists and the entire BBB simply hangs. Any SSH sessions I have open stop responding so I can't kill the process. I have to power down the board and power it back up.
When I connected the servo I did not use any resistors. But, based on a tutorial from Adafruit (for Python) I tried sticking a 1k ohm resistor on the positive. That prevented the servo from turning at all, but then the Java program didn't hang the BBB. I tried progressively smaller resistors, but nothing I had was small enough to let the servo turn. I think the lowest I tried was 220 ohm.
Anyhow, electronics are not my strong point, but I can't figure out why the Java code seems to be killing the BBB.
Any thoughts?