Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@11:657cdd3a0a5f, 2018-12-15 (annotated)
- Committer:
- Otakutronics
- Date:
- Sat Dec 15 22:40:06 2018 +0000
- Revision:
- 11:657cdd3a0a5f
- Parent:
- 10:956e173b7e3f
boton (PTE25) que enciende o apaga un led (LED_RED)
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 | |
| Otakutronics | 10:956e173b7e3f | 3 | DigitalIn btn(PTE25,PullUp); |
| Otakutronics | 10:956e173b7e3f | 4 | DigitalOut led(LED_RED,1); |
| Otakutronics | 10:956e173b7e3f | 5 | |
| Otakutronics | 10:956e173b7e3f | 6 | int main(){ |
| Otakutronics | 10:956e173b7e3f | 7 | while (1){ |
| Otakutronics | 10:956e173b7e3f | 8 | if (!btn){ |
| Otakutronics | 11:657cdd3a0a5f | 9 | while (!btn){ wait(0.05f);} |
| Otakutronics | 10:956e173b7e3f | 10 | led = !led; |
| Otakutronics | 10:956e173b7e3f | 11 | } |
| Otakutronics | 10:956e173b7e3f | 12 | } |
| Otakutronics | 10:956e173b7e3f | 13 | } |
| Otakutronics | 10:956e173b7e3f | 14 | /* |
| sam_grove | 9:32e85f1fcd15 | 15 | DigitalOut gpo(D0); |
| sam_grove | 9:32e85f1fcd15 | 16 | DigitalOut led(LED_RED); |
| chris | 0:0024ab6b9624 | 17 | |
| sam_grove | 9:32e85f1fcd15 | 18 | int main() |
| sam_grove | 9:32e85f1fcd15 | 19 | { |
| emilmont | 2:f37d74a0e3e2 | 20 | while (true) { |
| sam_grove | 9:32e85f1fcd15 | 21 | gpo = !gpo; // toggle pin |
| sam_grove | 9:32e85f1fcd15 | 22 | led = !led; // toggle led |
| sam_grove | 9:32e85f1fcd15 | 23 | wait(0.2f); |
| chris | 0:0024ab6b9624 | 24 | } |
| Otakutronics | 10:956e173b7e3f | 25 | } |
| Otakutronics | 10:956e173b7e3f | 26 | */ |