rangerskm
Full Member level 4
- Joined
- Jan 23, 2013
- Messages
- 199
- Helped
- 0
- Reputation
- 2
- Reaction score
- 0
- Trophy points
- 1,296
- Activity points
- 2,663
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.