CLASS DOCUMENTS


REPORTS & ASSIGNMENTS


CLASS CONTENT


USING THIS SITE








registered authors login here

You are: (logout)



For more on PMWiki, see pmwiki.org


Flex PIC

'************************** '* Name : Sensors & Time.BAS * '* Version : 1.0 * '* Notes : outputs analog sensor value '*************************** define osc 4

DEFINE ADC_BITS 10 ' Set number of bits in result DEFINE ADC_CLOCK 3 ' Set clock source (3=rc) DEFINE ADC_SAMPLEUS 20 ' Set sampling time in uS

tx var portc.6 rx var portc.7

n9600 con 16468

TRISA = %11111111 ADCON1 = %10000010

sensorValue var byte blinK var byte statusLED var portd.2 output portd.2 blink = 0

main:

if blink < 4 then high statusled pause 200 low statusled pause 200 blink = blink + 1 endif

adcin 0, sensorvalue serout2 tx, n9600, [sensorvalue]

pause 200

goto main

  Edit | View | History | Print | Recent Changes | Search Page last modified on April 10, 2006, at 03:42 PM