Shop OBEX P1 Docs P2 Docs Learn Events
SimpleIDE and Servo tutorial... — Parallax Forums

SimpleIDE and Servo tutorial...

SgtBFGunnerSgtBFGunner Posts: 33
edited 2015-01-13 05:53 in Learn with BlocklyProp
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
}

Comments

  • ElectrodudeElectrodude Posts: 1,621
    edited 2015-01-12 18:44
    Is this a continuous rotation or a standard servo? It sounds like the tutorial calls for a standard servo but you have a continuous rotation servo.
  • SgtBFGunnerSgtBFGunner Posts: 33
    edited 2015-01-12 18:54
    Is this a continuous rotation or a standard servo? It sounds like the tutorial calls for a standard servo but you have a continuous rotation servo.

    It is a standard servo...
  • SgtBFGunnerSgtBFGunner Posts: 33
    edited 2015-01-12 20:27
    Found my problem!!!
    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...)
  • SgtBFGunnerSgtBFGunner Posts: 33
    edited 2015-01-13 05:53
    Thanks jazzed. Too funny...
    Every once in a while I guess we need to be reminded, check the simple things. :)
Sign In or Register to comment.