SimpleIDE and Servo tutorial...
![SgtBFGunner](https://forums.parallax.com/uploads/userpics/330/nLL0ZMLN842QE.jpg)
Been struggling with the tutorials with Simple IDE, was 1.0.2 RC1 now running RC2.
After hours of trying to get a "File to SD card", if find that it needed a "patch"...
Now on to servos... Just trying to get it to move as directed. It is not even close...
System won't let me attach a ".side" file but the code is here... http://learn.parallax.com/propeller-c-simple-devices/standard-servo
The servo just goes from 0 degrees to maybe 10 degrees and back again, slowly, over and over. If I give it just one command to go to 0. 90 or 180, it will do it. But it does not seem like it is following the program, which also instructs it to stop at the end.
Am I missing something??? Another tutorial that is taking hours for no apparent reason.
My goal is to control the servo for the Ping sensor, which I can not find ActivityBot code for, so I'm going to try and figure it out.
The ActivityBot's servos are calibrated and work fine...
Thanks you for any insight you might be able to provide!
/*
Standard Servo Position.c
Moves servo to 0, 90 and 180 degrees. Holds each position for 2 s.
Connect servo to P16 port on Propeller ActivityBoard.
*/
#include "simpletools.h" // Include simpletools header
#include "servo.h" // Include servo header
int main() // main function
{
servo_angle(16, 0); // P16 servo to 0 degrees
pause(3000); // ...for 3 seconds
servo_angle(16, 900); // P16 servo to 90 degrees
pause(3000); // ...for 3 seconds
servo_angle(16, 1800); // P16 servo to 180 degrees
pause(3000); // ...for 3 seconds
servo_stop(); // Stop servo process
}
After hours of trying to get a "File to SD card", if find that it needed a "patch"...
Now on to servos... Just trying to get it to move as directed. It is not even close...
System won't let me attach a ".side" file but the code is here... http://learn.parallax.com/propeller-c-simple-devices/standard-servo
The servo just goes from 0 degrees to maybe 10 degrees and back again, slowly, over and over. If I give it just one command to go to 0. 90 or 180, it will do it. But it does not seem like it is following the program, which also instructs it to stop at the end.
Am I missing something??? Another tutorial that is taking hours for no apparent reason.
My goal is to control the servo for the Ping sensor, which I can not find ActivityBot code for, so I'm going to try and figure it out.
The ActivityBot's servos are calibrated and work fine...
Thanks you for any insight you might be able to provide!
/*
Standard Servo Position.c
Moves servo to 0, 90 and 180 degrees. Holds each position for 2 s.
Connect servo to P16 port on Propeller ActivityBoard.
*/
#include "simpletools.h" // Include simpletools header
#include "servo.h" // Include servo header
int main() // main function
{
servo_angle(16, 0); // P16 servo to 0 degrees
pause(3000); // ...for 3 seconds
servo_angle(16, 900); // P16 servo to 90 degrees
pause(3000); // ...for 3 seconds
servo_angle(16, 1800); // P16 servo to 180 degrees
pause(3000); // ...for 3 seconds
servo_stop(); // Stop servo process
}
Comments
It is a standard servo...
What's the first rule of PC Troubleshooting..."Check the Power!!!"
My AC adapter was plugged in to a power strip, and the servo was moving a bit and code uploaded to the Propeller, ASSUMED that power was on.
It was not...
Amazing what electricity does for electrical components! SMH...
Servo works fine now. (embarrassed... let the flogging begin...)
Every once in a while I guess we need to be reminded, check the simple things.