servo only moving to first position
jsully83
Posts: 5
I'm trying to port the Ping)))Dar to the propeller 1 board with no success. I've hooked up a standard servo to port 16 on the Propeller Activity Board and tried running the provided code to move a servo to three different positions. It only moves to the first position and stops. Does anyone have any ideas as to why this would happen?
Thanks
Thanks
Comments
/code
should be etc.
The most current SimpleIDE Learn folder shows the example starts with pin 16; did you modify the code commands? If not, I first suggest downloading/installing the newest Learn folder and trying again. Changing the the code to P16 or moving the servo connection to P12 should work too.
I'm using the Propeller Activity Bot with the P8X32A processor on the board. I'm trying to port the PingDar code written for the basicstamp to C with SimpleIDE.
I can get the servo to move to a specific position and stop. For example, in the starter code provided in the SimpleIDE install which I've posted here the servo will spin to the first position (0 degrees), but it will not move to the second position (90 degrees) or the third position (180 degrees). I've tried using different servos (all standard servos). I've tried different ports (0, 1, 12, 16). I've tried using different 2 types of code in SimpleIDE and in PropellerIDE. Nothing is working, and I've no clue why.
The code in SimpleIDE I'm using is the above code (always in the correct port) and this code using the servo.h library -
and this code using the information for the standard servo documentation about PWM:
and also this starter code in PropellerIDE -
I all cases the servo(I've tried 3 separate ones) will either 1) move to the first position and stop or 2) not move at all.
Any help is appreciated.
For the life of me I can't seem to figure out why this is happening.
If you could power your servos from a separate source, say 4 AA batteries, I bet your trouble would go away.
Also, to verify that is what is happening, you can use the serial port to send messages to a computer running "Parallax Serial Terminal" at points in your code.
When the messages stop, that is probably when the Prop got reset. If program is in EEPROM, you'll see it start over...
You were RIGHT! Thank you so much! I don't have a separate battery pack, but I did try loading to EEPROM and putting in a simple print command. The board is resetting after every first move. After doing this I went through the standard servo documentation more carefully, like I should have in the first place, and noticed that there is a sentence on how the standard servo may work unexpectedly if using unregulated wall-mount power. It works like it should when I only use the 5 AA battery pack mounted under the chassis.
Thanks for your help!!
http://forums.parallax.com/showthread.php/160464-Seeking-source-code-for-ActivityBot-with-ping-amp-sweep-(570-28015)-in-Propeller