Shop OBEX P1 Docs P2 Docs Learn Events
need some help with programming — Parallax Forums

need some help with programming

b0ib0i07b0ib0i07 Posts: 33
edited 2010-09-29 19:12 in BASIC Stamp
My intention is to program a motor with feedback.
I want to program it in such a way that if the feedback is between value A to value B, the motor will stop.

* If ????? THEN
pulsout 14, 750


Any1 can help me with the question mark??

* using BS2 and HB25 *

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2010-09-29 04:57
    The final solution will depend on what you use as a feedback device.

    Suppose it was a switch connected to pin 1: (this is not a compete program)
    if in1 = 1 then
    pulsout 14, 750
    endif

    Or, suppose you were tracking pulses from an encoder:
    if pulscount > 400 AND pulscount < 500 then
    pulsout 14, 750
    endif

    There are other possibilities.
  • b0ib0i07b0ib0i07 Posts: 33
    edited 2010-09-29 19:12
    thanks!
Sign In or Register to comment.