mohammad shokri
/
mbed_blinky
blink leds
main.cpp@0:1d9e68d929a1, 2014-04-17 (annotated)
- Committer:
- m_online3710
- Date:
- Thu Apr 17 17:20:18 2014 +0000
- Revision:
- 0:1d9e68d929a1
blink leds
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
m_online3710 | 0:1d9e68d929a1 | 1 | #include "mbed.h" |
m_online3710 | 0:1d9e68d929a1 | 2 | |
m_online3710 | 0:1d9e68d929a1 | 3 | // LED1 = P1.18 LED2 = P1.20 LED3 = P1.21 LED4 = P1.23 |
m_online3710 | 0:1d9e68d929a1 | 4 | #define LED_MASK 0x0000000F |
m_online3710 | 0:1d9e68d929a1 | 5 | #define LED_MASK1 0x000000F0 |
m_online3710 | 0:1d9e68d929a1 | 6 | |
m_online3710 | 0:1d9e68d929a1 | 7 | PortOut ledport(Port2, 0x000000FF); |
m_online3710 | 0:1d9e68d929a1 | 8 | |
m_online3710 | 0:1d9e68d929a1 | 9 | int main() { |
m_online3710 | 0:1d9e68d929a1 | 10 | while(1) { |
m_online3710 | 0:1d9e68d929a1 | 11 | ledport = LED_MASK; |
m_online3710 | 0:1d9e68d929a1 | 12 | wait(1); |
m_online3710 | 0:1d9e68d929a1 | 13 | ledport = LED_MASK1; |
m_online3710 | 0:1d9e68d929a1 | 14 | wait(1); |
m_online3710 | 0:1d9e68d929a1 | 15 | } |
m_online3710 | 0:1d9e68d929a1 | 16 | } |