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@1:e7d2231abccc, 2018-07-03 (annotated)
- Committer:
- zeneto
- Date:
- Tue Jul 03 18:06:29 2018 +0000
- Revision:
- 1:e7d2231abccc
- Parent:
- 0:00e9a2a6f73a
- Child:
- 2:82e0ae145867
ds
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
zeneto | 0:00e9a2a6f73a | 1 | #include "mbed.h" |
zeneto | 1:e7d2231abccc | 2 | |
zeneto | 1:e7d2231abccc | 3 | InterruptIn btn(D7); |
zeneto | 1:e7d2231abccc | 4 | DigitalOut led(LED_BLUE); |
zeneto | 1:e7d2231abccc | 5 | |
zeneto | 1:e7d2231abccc | 6 | void button_pressed() { |
zeneto | 1:e7d2231abccc | 7 | led = !led; // toggle the LED |
zeneto | 0:00e9a2a6f73a | 8 | } |
zeneto | 0:00e9a2a6f73a | 9 | |
zeneto | 1:e7d2231abccc | 10 | int main(int, char**) { |
zeneto | 1:e7d2231abccc | 11 | btn.fall(&button_pressed); // whenever the button falls, execute button_pressed function |
zeneto | 1:e7d2231abccc | 12 | |
zeneto | 1:e7d2231abccc | 13 | while (1) {} |
zeneto | 0:00e9a2a6f73a | 14 | } |