Okay I have had a go & failedWhat am I doing wrong?
Code:'PIC12f683 #CONFIG __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF #ENDCONFIG DEFINE OSC 4 '4mhz ocsillator ANSEL = %00000010 'pin 6 analog CMCON0 = %00000100 'comparator mode VRCON = %00001000 'voltage reference TRISIO = %00000010 'pin 6 input POTEN VAR CMCON0.1 'pot pin 6 LED VAR GPIO.2 'led pin 5 PAUSE 20 main: IF CMCON0.1 = 1 THEN HIGH LED ELSE LOW LED ENDIF GOTO main


What am I doing wrong?

Also this is correct - As I understand you want to check the input pin voltage against your "1.1" reference you are setting up internally and have the following outcomes: If the input is "Lower than 1.075 Vdc" you want the LED to be OFF and you want the LED to be "ON when the input is Higher than 1.075 Vdc".

Bookmarks