Friday, April 14, 2006

code_working

'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2006 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 4/14/2006 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
DEFINE OSC 4

DEFINE ADC_BITS 8
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEuS 20

RedLed var portd.1 'to test transmitted data
bluLed var portd.0 'to test received data from pd

measurement VAR BYTE
counter VAR BYTE

outPin var portc.6 'transmitting pin

counter=0

TRISA=%11111111 'to set all portA to analogue input
ADCON1=%00000010

main:

adcin 0, measurement
serout2 outPin, 16468, [DEC measurement,13,10]

high REdLed
pause 50
Low RedLed
counter=counter+1

Pause 100

goto main

0 Comments:

Post a Comment

<< Home