'reading a variable resistor (such as a potentiometer or 'photoresistor) with RCTIME 'CIRCUIT DIAGRAM AT END OF FILE rcPin PIN 8 'input/output pin for RCTIME rValue VAR WORD 'reading from RCTIME rValuePrev VAR WORD 'previous value DEBUG CR,"program starting...",CR top: HIGH rcPin 'set pin high PAUSE 1 'pause for 1ms RCTIME rcPin,1,rValue 'read the pin IF rValue <> rValuePrev THEN 'check if value has changed rValuePrev = rValue 'record new value DEBUG "current value: ",DEC rValue,CR ENDIF PAUSE 50 GOTO top 'return to beginning ' CIRCUIT: ' ' +5v --- .01uF --- 220ohm -- INPUT_PIN ' | ' PHOTORESISTOR [RADIO SHACK #276-1657] ' | ' GROUND ' '