Shop OBEX P1 Docs P2 Docs Learn Events
counting command options on BS2p40 — Parallax Forums

counting command options on BS2p40

djgilmo32djgilmo32 Posts: 10
edited 2005-11-01 15:24 in Learn with BlocklyProp
I am working on a senior project and I'd like to figure how to count how long a pin stays high everytime it does so. I dont think "count" works because the period is for counting AC right?

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-01 15:24
    COUNT is for counting pulses, this is correct. You'll have to watch for your input line to go to the desired state, and then increment a timer until the state changes back -- this is actually quite trivial unless the pulses are very narrow, but then, we have a command for that....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.