You can read that in the manual which came to your version of PBP.
Here then a smal example with no comment. Try to find the comment in the manual.
Code:@ DEVICE PIC16F877A,XT_OSC @ DEVICE PIC16F877A,BOD_OFF @ DEVICE PIC16F877A,LVP_OFF @ DEVICE PIC16F877A,CPD_OFF @ DEVICE PIC16F877A,PROTECT_OFF DEFINE ADC_BITS 8 DEFINE ADC_CLOCK 3 DEFINE ADC_SAMPLEUS 50 DEFINE OSC 4 ADCON1 = %00000010 TRISA = %11111111 TRISB = %00000000 TRISC = %10000001 LEDPIN VAR PORTB.0 VALUE0 VAR BYTE CLEAR START: ADCIN 0,VALUE0 IF VALUE0 > 127 THEN LEDPIN = 1 ELSE LEDPIN = 0 ENDIF GOTO START END




Bookmarks