rangerskm
Full Member level 4
Code:
#define LED1 (1 << 10)
#define LED2 (1 << 11)
#define BUTTON1 (1 << 15)
#define BUTTON2 (1 << 16)
int main(void)
{
// Set buttons as input
GPIO0_IODIR &= ~(BUTTON1 | BUTTON2);
// Set LEDs as output
GPIO0_IODIR |= (LED1 | LED2);
// Turn both LEDS off (set them 'high')
GPIO0_IOSET |= (LED1 | LED2);
please explain the actual working of codes inside the main function with an example.