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.
Revision 14:defc334658db, committed 2016-08-15
- Comitter:
- GregC
- Date:
- Mon Aug 15 03:36:56 2016 +0000
- Parent:
- 13:e702b6efb480
- Commit message:
- Hexiwear GPIO program example
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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
