
Originally Posted by
Demon
How is the LED connected to the PIC?
Robert
EDIT: And what did you use as CONFIG and TRIS settings?
positive end is connected to the pin, negative end is grounded
Code:
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_OFF & _MCLRE_OFF & _BODEN_OFF & _LVP_OFF
Define OSC 4
LED4 VAR PortA.1
button VAR PortA.2
CMCON = 7
VRCON = 0
PortA=0
PortB = 000100
T1CON = 000011
TRISA = 000100
TRISB = 000000
and this code works though, which is really confusing me
Code:
new:
if button=0 then
led4=1
pause 500
led4=0
endif
goto new
Bookmarks