By Tom Igoe, 1 Oct. 2005

This PicBasic Pro code reads a value from an RC Circuit. RCTIME is a useful command that can be used to read variable resistors on pins of a microcontroller that are not analog inputs.

'   RCTime example
'   By Tom Igoe, 10/1/05
'   For PicBasic Pro
'   Takes in a value from an RC circuit on pin portd.1


rcVar var word
main:
    high portd.1
    pause 1
    rctime portd.1, 1, rcVar
    serout2 portc.6, 16468, [DEC rcVar, 13, 10]
goto main