GPIO program example for Hexiwear
Fork of Hexi_Blinky_Example by
This project demonstrates the use of a Hexiwear GPIO
Pin PTB13 accessible via the Docking station (pin INT socket 1) will toggle and RGB LED will blink Green accordingly.
Diff: main.cpp
- Revision:
- 14:defc334658db
- Parent:
- 4:81cea7a352b0
--- a/main.cpp Fri Aug 12 18:36:42 2016 +0000 +++ b/main.cpp Mon Aug 15 03:36:56 2016 +0000 @@ -1,12 +1,13 @@ #include "mbed.h" -DigitalOut myled(LED1); +DigitalOut gpo(PTB13); +DigitalOut led(LED_GREEN); -int main() { - while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); +int main() +{ + while (true) { + gpo = !gpo; // toggle pin + led = !led; // toggle led + wait(0.2f); } -} +} \ No newline at end of file