gpio example for the Freescale freedom platform
Dependencies: mbed
Fork of frdm_gpio by
main.cpp@9:32e85f1fcd15, 2014-07-16 (annotated)
- Committer:
- sam_grove
- Date:
- Wed Jul 16 09:49:22 2014 +0000
- Revision:
- 9:32e85f1fcd15
- Parent:
- 6:a80519d6fdda
Update example to toggle faster and move object declarations to global scope
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:0024ab6b9624 | 1 | #include "mbed.h" |
chris | 0:0024ab6b9624 | 2 | |
sam_grove | 9:32e85f1fcd15 | 3 | DigitalOut gpo(D0); |
sam_grove | 9:32e85f1fcd15 | 4 | DigitalOut led(LED_RED); |
chris | 0:0024ab6b9624 | 5 | |
sam_grove | 9:32e85f1fcd15 | 6 | int main() |
sam_grove | 9:32e85f1fcd15 | 7 | { |
emilmont | 2:f37d74a0e3e2 | 8 | while (true) { |
sam_grove | 9:32e85f1fcd15 | 9 | gpo = !gpo; // toggle pin |
sam_grove | 9:32e85f1fcd15 | 10 | led = !led; // toggle led |
sam_grove | 9:32e85f1fcd15 | 11 | wait(0.2f); |
chris | 0:0024ab6b9624 | 12 | } |
chris | 0:0024ab6b9624 | 13 | } |