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.
main.cpp@14:defc334658db, 2016-08-15 (annotated)
- Committer:
- GregC
- Date:
- Mon Aug 15 03:36:56 2016 +0000
- Revision:
- 14:defc334658db
- Parent:
- 4:81cea7a352b0
Hexiwear GPIO program example
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dan | 0:7dec7e9ac085 | 1 | #include "mbed.h" |
dan | 0:7dec7e9ac085 | 2 | |
GregC | 14:defc334658db | 3 | DigitalOut gpo(PTB13); |
GregC | 14:defc334658db | 4 | DigitalOut led(LED_GREEN); |
dan | 0:7dec7e9ac085 | 5 | |
GregC | 14:defc334658db | 6 | int main() |
GregC | 14:defc334658db | 7 | { |
GregC | 14:defc334658db | 8 | while (true) { |
GregC | 14:defc334658db | 9 | gpo = !gpo; // toggle pin |
GregC | 14:defc334658db | 10 | led = !led; // toggle led |
GregC | 14:defc334658db | 11 | wait(0.2f); |
stevep | 4:81cea7a352b0 | 12 | } |
GregC | 14:defc334658db | 13 | } |