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@8:a479ab0a14ef, 2017-09-04 (annotated)
- Committer:
- ccli8
- Date:
- Mon Sep 04 09:41:59 2017 +0800
- Revision:
- 8:a479ab0a14ef
- Parent:
- 6:b3369ce1a600
- Child:
- 10:286c71f85d6f
Update mbed-os to mbed-os-5.5.6
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ccli8 |
6:b3369ce1a600 | 1 | // GPIO interrupt to set led on/off |
| rkuo2000 | 0:29e056412215 | 2 | #include "mbed.h" |
| ccli8 |
8:a479ab0a14ef | 3 | |
| shliu1 |
5:b9b7cd06aaf0 | 4 | #if defined(TARGET_NUMAKER_PFM_NUC472) |
| ccli8 |
8:a479ab0a14ef | 5 | InterruptIn button(SW1); |
| ccli8 |
8:a479ab0a14ef | 6 | DigitalOut led(LED1); |
| shliu1 |
5:b9b7cd06aaf0 | 7 | #elif defined(TARGET_NUMAKER_PFM_M453) |
| ccli8 |
8:a479ab0a14ef | 8 | InterruptIn button(SW2); |
| ccli8 |
8:a479ab0a14ef | 9 | DigitalOut led(LED1); |
| ccli8 |
8:a479ab0a14ef | 10 | #elif defined(TARGET_NUMAKER_PFM_M487) |
| ccli8 |
8:a479ab0a14ef | 11 | InterruptIn button(SW2); |
| ccli8 |
8:a479ab0a14ef | 12 | DigitalOut led(LED1); |
| shliu1 |
5:b9b7cd06aaf0 | 13 | #endif |
| rkuo2000 | 0:29e056412215 | 14 | |
| rkuo2000 | 0:29e056412215 | 15 | void flip() { |
| rkuo2000 | 0:29e056412215 | 16 | led = !led; |
| rkuo2000 | 0:29e056412215 | 17 | } |
| rkuo2000 | 0:29e056412215 | 18 | |
| rkuo2000 | 0:29e056412215 | 19 | int main() { |
| ccli8 |
2:15b06747ce59 | 20 | button.rise(&flip); |
| rkuo2000 | 0:29e056412215 | 21 | } |