Hi guys,
Say if I want to turn on a couple of leds, the following codes work fine:
or
but if I use the following codes, only the LED2 lights up, why?
I am using MPLAB X with XC8 complier, PIC12F683 under win7.
LED1 and LED2 are defined at the beginning of the code.
PIC12F683 datasheet
Say if I want to turn on a couple of leds, the following codes work fine:
Rich (BB code):
GPIO |= (1<<LED1)+(1<<LED2);
Rich (BB code):
GPIO |= (1<<LED2);
GPIO |= (1<<LED1);
Rich (BB code):
GPIO |= (1<<LED1);
GPIO |= (1<<LED2);
LED1 and LED2 are defined at the beginning of the code.
PIC12F683 datasheet
Last edited: