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.
Dependencies: mbed
main.cpp@1:bf24c62c6310, 2016-11-10 (annotated)
- Committer:
- Goran002
- Date:
- Thu Nov 10 19:02:42 2016 +0000
- Revision:
- 1:bf24c62c6310
- Parent:
- 0:d2afa897dbc9
- Child:
- 2:928931868ac8
VT2_Goran Herek
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Goran002 | 0:d2afa897dbc9 | 1 | #include "mbed.h" |
| Goran002 | 1:bf24c62c6310 | 2 | InterruptIn button(p18); // Interrupt on digital pushbutton input p18 |
| Goran002 | 1:bf24c62c6310 | 3 | DigitalOut led1(p5); // digital out to p5 |
| Goran002 | 1:bf24c62c6310 | 4 | void toggle(void); // function prototype |
| Goran002 | 0:d2afa897dbc9 | 5 | int main() { |
| Goran002 | 1:bf24c62c6310 | 6 | button.rise(&toggle); // attach the address of the toggle |
| Goran002 | 1:bf24c62c6310 | 7 | } // function to the rising edge |
| Goran002 | 1:bf24c62c6310 | 8 | void toggle() { |
| Goran002 | 1:bf24c62c6310 | 9 | led1=!led1; |
| Goran002 | 0:d2afa897dbc9 | 10 | } |