2011_Activity #2 - Measuring resitance by measurng time

2011_Activity #2 - Measuring resitance by measurng time - N...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
' What's a Microcontroller - PolledRcTimer.bs2 ' Reaction timer program modified to track an RC-timer voltage delay. ' ' {$STAMP BS2} ' {$PBASIC 2.5} ' timeCounter VAR Word counter VAR Word c DEBUG CLS D HIGH 7 DEBUG "Capacitor Charging. ..", CR D FOR counter = 5 TO 0 PAUSE 1000 DEBUG DEC2 counter, CER, CRSRUP NEXT
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: N DEBUG CR, CR, "Measure delay time now!", CR, CR INPUT 7 I DO PAUSE 100 timeCounter = timeCounter + 1 DEBUG ? IN7 DEBUG DEC5 timeCounter, CR, CRSRUP, CRSRUP LOOP UNTIL IN7 = 0 L DEBUG CR, CR, CR, "The RC delay time was "' DEC timeCounter, CR, "tenths of a second.", CR, CR END...
View Full Document

Ask a homework question - tutors are online