Shop OBEX P1 Docs P2 Docs Learn Events
Read Servo Value? — Parallax Forums

Read Servo Value?

ItsMeNickItsMeNick Posts: 19
edited 2008-09-03 04:02 in BASIC Stamp
I have another circuit which is outputting to a servo.

Can I direct that to an IO pin on a BS2 to see the values it's driving to the servo?
Would I use pulsin?

Any help is appreciated!

Thanks,
-Nick

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-03 04:02
    Yes to both questions. The main problem you will have is synchronizing your measurements with the incoming pulses. It's not a big deal. The issue is that you can't time a pulse if it has already started, so you have to wait for the input to be HIGH, then LOW before starting the PULSIN. The PULSIN will wait for the next pulse to start, then measure its width. If you know (or measure) the time between pulses, you can do something else useful before doing the next PULSIN.
Sign In or Register to comment.