Shop OBEX P1 Docs P2 Docs Learn Events
Change read pulsin data to ms — Parallax Forums

Change read pulsin data to ms

DukeDuke Posts: 21
edited 2005-06-20 04:50 in BASIC Stamp
Hi,

I'm using Basic stamp 2P with pulse width·measuring work.
from·the·command·pulsin·I get·pulse·data in variable (word)
that·read 388
How can I convert this value to ms (milisec)

From the 2P's reference book, they says multiply by 0.8 to convert to microsec
but same pulse read by osciloscope don't seems to be equal to the calculation.
From scope I can read 0.6 ms.

Thank you in advance.
Duke..

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-20 03:40
    You should post your code -- it's curious that what you're measing with a 'scope is exactly twice what you should be measuring (388 x 0.8 uS = 310 uS).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • DukeDuke Posts: 21
    edited 2005-06-20 04:50
    The code is simple

    PULSIN 12,1,P_SIG

    I use mainio P12 as input , P_SIG as var word and monitor High Level Signal
Sign In or Register to comment.