Shop OBEX P1 Docs P2 Docs Learn Events
measuring digital signal — Parallax Forums

measuring digital signal

TGTG Posts: 36
edited 2005-10-18 15:11 in BASIC Stamp
I want to measure the time between two digital signals. Is there a command to measure this?

Post Edited (TG) : 10/18/2005 3:26:57 AM GMT

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-18 04:04
    If you're looking for the edges of a single pulse then PULSIN will work for you.· If you have two separate pulses then you'll need to create your own timer routine:

    Measure_Time:
    · DO : LOOP UNTIL (Trigger = 1)····· ' wait for edge of first pulse
    · DO································ ' measure width of first pulse
    ··· measure = measure + 1
    · LOOP WHILE (Trigger = 1)
    · DO································ ' measure time to second pulse
    ··· measure = measure + 1
    · LOOP UNTIL (Trigger = 1)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • TGTG Posts: 36
    edited 2005-10-18 14:55
    The signals are from two different sources. I think I have an idea how to do it from your example. Thanks
  • Tricky NekroTricky Nekro Posts: 218
    edited 2005-10-18 15:11
    Easy to fix it over...

    Label:

    IF (tri1 = 1)·AND (tri2 = 1) THEN label1

    ELSEIF (tri1=1)·OR··(tri2 = 1) THEN label

    ELSE label

    idea.gif
    Friendly, Provas, GREECE....


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--
Sign In or Register to comment.