CLASS DOCUMENTS


REPORTS & ASSIGNMENTS


CLASS CONTENT


USING THIS SITE








registered authors login here

You are: (logout)



For more on PMWiki, see pmwiki.org


RC Time

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

  Edit | View | History | Print | Recent Changes | Search Page last modified on January 16, 2006, at 02:47 PM