Digital Output simple example for WIZwiki-W7500 academy
Dependencies: mbed
Fork of DigitalOut_HelloWorld_WIZwiki-W7500 by
main.cpp@9:830f3db9d8b2, 2015-12-08 (annotated)
- Committer:
- IOP
- Date:
- Tue Dec 08 00:06:03 2015 +0000
- Revision:
- 9:830f3db9d8b2
- Parent:
- 8:9857ad80f52e
- Child:
- 10:31436dd26b70
update
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joon874 | 2:a40176947d21 | 1 | /* Digital Output Example Program */ |
joon874 | 2:a40176947d21 | 2 | |
joon874 | 3:feaf2432da5b | 3 | #include "mbed.h" |
joon874 | 0:6cda4e0af931 | 4 | |
IOP | 9:830f3db9d8b2 | 5 | DigitalOut myled_R(LED_RED); // LED_RED on WIZwiki-W7500 |
IOP | 9:830f3db9d8b2 | 6 | DigitalOut myled_G(LED_GREEN); // LED_GREEN on WIZwiki-W7500 |
IOP | 9:830f3db9d8b2 | 7 | DigitalOut myled_B(LED_BLUE); // LED_BLUE on WIZwiki-W7500 |
joon874 | 3:feaf2432da5b | 8 | int main() |
IOP | 6:237a4d28a84f | 9 | { |
joon874 | 0:6cda4e0af931 | 10 | while(1) { |
IOP | 7:d4c147471a03 | 11 | myled_R = 0; // Red LED ON |
IOP | 7:d4c147471a03 | 12 | myled_G = 1; // Green LED OFF |
IOP | 9:830f3db9d8b2 | 13 | myled_B = 1; // Blue LED OFF |
IOP | 7:d4c147471a03 | 14 | wait(0.5); // 0.5 sec delay |
IOP | 7:d4c147471a03 | 15 | myled_R = 1; // Red LED OFF |
IOP | 9:830f3db9d8b2 | 16 | myled_G = 0; // Green LED ON |
IOP | 9:830f3db9d8b2 | 17 | myled_B = 1; // Blue LED OFF |
IOP | 6:237a4d28a84f | 18 | wait(0.5); // 0.5 sec delay |
IOP | 7:d4c147471a03 | 19 | myled_R = 1; // Red LED OFF |
IOP | 9:830f3db9d8b2 | 20 | myled_G = 1; // Green LED OFF |
IOP | 9:830f3db9d8b2 | 21 | myled_B = 0; // Blue LED ON |
IOP | 6:237a4d28a84f | 22 | wait(0.5); // 0.5 sec delay |
IOP | 7:d4c147471a03 | 23 | myled_R = 0; // Red LED ON |
IOP | 9:830f3db9d8b2 | 24 | myled_G = 0; // Green LED ON |
IOP | 9:830f3db9d8b2 | 25 | myled_B = 0; // Blue LED ON |
IOP | 6:237a4d28a84f | 26 | wait(0.5); // 0.5 sec delay |
joon874 | 0:6cda4e0af931 | 27 | } |
joon874 | 0:6cda4e0af931 | 28 | } |