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@0:cecb923bd4c3, 2016-12-01 (annotated)
- Committer:
- megha1118
- Date:
- Thu Dec 01 08:24:31 2016 +0000
- Revision:
- 0:cecb923bd4c3
megha
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
megha1118 | 0:cecb923bd4c3 | 1 | #include "mbed.h" |
megha1118 | 0:cecb923bd4c3 | 2 | DigitalOut led1(LED1); |
megha1118 | 0:cecb923bd4c3 | 3 | InterruptIn button(p7); |
megha1118 | 0:cecb923bd4c3 | 4 | |
megha1118 | 0:cecb923bd4c3 | 5 | void fun1() |
megha1118 | 0:cecb923bd4c3 | 6 | { |
megha1118 | 0:cecb923bd4c3 | 7 | led1=1; |
megha1118 | 0:cecb923bd4c3 | 8 | } |
megha1118 | 0:cecb923bd4c3 | 9 | void fun2() |
megha1118 | 0:cecb923bd4c3 | 10 | { |
megha1118 | 0:cecb923bd4c3 | 11 | led1=0; |
megha1118 | 0:cecb923bd4c3 | 12 | } |
megha1118 | 0:cecb923bd4c3 | 13 | |
megha1118 | 0:cecb923bd4c3 | 14 | |
megha1118 | 0:cecb923bd4c3 | 15 | |
megha1118 | 0:cecb923bd4c3 | 16 | int main() |
megha1118 | 0:cecb923bd4c3 | 17 | { |
megha1118 | 0:cecb923bd4c3 | 18 | button.rise(&fun1); |
megha1118 | 0:cecb923bd4c3 | 19 | button.fall(&fun2); |
megha1118 | 0:cecb923bd4c3 | 20 | while(1) |
megha1118 | 0:cecb923bd4c3 | 21 | { |
megha1118 | 0:cecb923bd4c3 | 22 | |
megha1118 | 0:cecb923bd4c3 | 23 | } |
megha1118 | 0:cecb923bd4c3 | 24 | } |
megha1118 | 0:cecb923bd4c3 | 25 | |
megha1118 | 0:cecb923bd4c3 | 26 |