Shop OBEX P1 Docs P2 Docs Learn Events
Does PULSIN round up or down? — Parallax Forums

Does PULSIN round up or down?

RoboronRoboron Posts: 9
edited 2010-02-23 17:00 in BASIC Stamp
PULSIN for BS2 measures in 2usec intervals.· If I have a pulse that is 2.5usec will it be regarded by BS2·as a 2usec or 4usec pulse?

Thanks

Comments

  • Tracy AllenTracy Allen Posts: 6,662
    edited 2010-02-22 16:35
    I believe it rounds up. As soon as it detects a leading edge, that counts as one. After 2 us, it becomes 2. The only way it returns zero is if the pulse is longer than 0.131070 second, or if a leading edge is not detected within 0.131072 second. That is the "error" marker.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • RoboronRoboron Posts: 9
    edited 2010-02-23 17:00
    Thank you very much.
Sign In or Register to comment.