Shop OBEX P1 Docs P2 Docs Learn Events
Diffrent outcome each time — Parallax Forums

Diffrent outcome each time

teganburnsteganburns Posts: 134
edited 2013-05-21 07:35 in Propeller 1
Im messing around with a servo and i get a different outcome each time.

If you look at the code provided you can see at the end of "Pub demo" position is set to 125 (this is centered)

I load the code into the eeprom with F11. when the code is executed after being loaded it will sometimes snap back into place (position 125) and other times not. (after pressing reset)

Using the prop plug, and a micro servo
1024 x 768 - 78K

Comments

  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-05-20 16:42
    Bump the servo cog stack size to 16. Not sure it will help as it sounds like you have a possible electrical problem. You might want to put a 100uF cap across your power rails, too.
  • teganburnsteganburns Posts: 134
    edited 2013-05-20 18:32
    Alright ill try it out, I shouldn't be hurting the propeller chip though right?
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-05-20 19:04
    It's not a good idea to connect a servo directly to a Propeller pin -- my opinion. Use a 1K resistor or a 100-ohm/0.01uF RC filter. Servos are noise and you could be getting Smile back in on the IO pin.
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-05-21 07:35
    Your power source is out of the picture. What are you using to provide power? Servos and power issues are common too. They take more power than just running the propeller and can cause the propeller to reset unexpectedly.
Sign In or Register to comment.