Shop OBEX P1 Docs P2 Docs Learn Events
counting pulses — Parallax Forums

counting pulses

Lab RatLab Rat Posts: 289
edited 2008-11-13 11:37 in BASIC Stamp
how do i count incoming pulses from say a shaft encoder and have the power to the motor cut after X number of pulses??

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Parallax posesses power beyond belief.

Believe in it.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-11-13 02:15
    I'd use count or pulsin for starters.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Lab RatLab Rat Posts: 289
    edited 2008-11-13 02:38
    ok i did my homework

    count counts number of pulses in given time frame

    and pulsein reads how long the pulses are

    how do i take that and translate it to a distance that the stamp can resuse

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax posesses power beyond belief.

    Believe in it.

    Post Edited (Lab Rat) : 11/13/2008 3:10:21 AM GMT
  • gncguygncguy Posts: 35
    edited 2008-11-13 04:03
    If you want the distance the robot has traveled and you are willing to assume that the wheel never slips (that the robot never gets stuck and spins its wheels), you just multiply the circumference of the wheel by the number of revolutions of the shaft.
  • Lab RatLab Rat Posts: 289
    edited 2008-11-13 11:37
    can that be done withe programing??

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax posesses power beyond belief.

    Believe in it.
Sign In or Register to comment.