Shop OBEX P1 Docs P2 Docs Learn Events
RCTIME does not appear to work for me — Parallax Forums

RCTIME does not appear to work for me

ChuckCChuckC Posts: 3
edited 2009-02-10 06:55 in Learn with BlocklyProp
RCTIME does not appear to work for me. I have the "What's a microcontroller student guide" and have been having a great learning experience. I have hit nearly a dead end on Chapter 5, "Measuring Rotation". I successfully completed PolledRCTimer.bs2. It worked but using the ReadPotWithRcTime.bs2 does not - it just sits there, green light on. I tried looking for RCTIME in Help,copied the program and pasted it into mine, it does not work. This is the program:

' {$STAMP BS2}
' {$PBASIC 2.5}

result VAR Word

HIGH 7 ' charge the cap
PAUSE 1 ' for 1 ms
RCTIME 7, 1, result ' measure RC discharge time
DEBUG DEC ? result ' display result
END

That's it - does nothing - seems caught in a loop (activity LED stays on). I can use the same RC combo in my original, but not in this program with RCTIME.

Any comments. This is really bothering me. Direct cut and paste.

Thanks.

Comments

  • ChuckCChuckC Posts: 3
    edited 2009-02-10 06:55
    Figured it out. The raw program did not count nearly as fast as RCTIME. Using the RC values I had for the crude RC Time, I went over the WORD max value. decreasing the values fixed it.

    Now i have another question.
Sign In or Register to comment.