DEFINE OSC 4 DEFINE ADC_BITS 8 DEFINE ADC_CLOCK 3 DEFINE ADC_SAMPLEuS 20 ADCON1 = %00000010 TRISA = %11111111 grLed var portd.0 ylLed var portd.1 txPin var portc.6 rxPin var portc.7 output grled output ylled output txpin input rxpin proxVar var byte potVAR VAR BYTE pot2VAR var byte inByte var byte pause 500 high grled pause 300 low grled pause 150 high grled main: low ylled serin2 rxpin, 16468, 20, main, [inbyte] high ylled if inbyte = 65 then adcin 0, proxvar adcin 1, potvar adcin 2, pot2var serout2 txpin, 16468, [proxvar, potvar, pot2var] endif if inbyte = 1 then adcin 0, proxvar serout2 txpin, 16468, [proxvar] endif if inbyte = 2 then adcin 1, potvar serout2 txpin, 16468, [potvar] endif if inbyte = 3 then adcin 2, pot2VAR serout2 txpin, 16468, [pot2var] endif goto main