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.
Fork of switchcount by
main.cpp@0:af296e7fa008, 2013-06-06 (annotated)
- Committer:
- sjsvarma
- Date:
- Thu Jun 06 09:32:36 2013 +0000
- Revision:
- 0:af296e7fa008
led flashes with 10 push button count
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sjsvarma | 0:af296e7fa008 | 1 | #include "mbed.h" |
| sjsvarma | 0:af296e7fa008 | 2 | |
| sjsvarma | 0:af296e7fa008 | 3 | DigitalOut myled1(LED1); |
| sjsvarma | 0:af296e7fa008 | 4 | DigitalIn myswitch(p20); |
| sjsvarma | 0:af296e7fa008 | 5 | int i=1; |
| sjsvarma | 0:af296e7fa008 | 6 | int main() { |
| sjsvarma | 0:af296e7fa008 | 7 | while(1) |
| sjsvarma | 0:af296e7fa008 | 8 | { |
| sjsvarma | 0:af296e7fa008 | 9 | if(myswitch==1) |
| sjsvarma | 0:af296e7fa008 | 10 | { |
| sjsvarma | 0:af296e7fa008 | 11 | wait(0.5); |
| sjsvarma | 0:af296e7fa008 | 12 | if(i==10) |
| sjsvarma | 0:af296e7fa008 | 13 | { |
| sjsvarma | 0:af296e7fa008 | 14 | myled1 = 1; |
| sjsvarma | 0:af296e7fa008 | 15 | wait(3); |
| sjsvarma | 0:af296e7fa008 | 16 | i=0; |
| sjsvarma | 0:af296e7fa008 | 17 | myled1 = 0; |
| sjsvarma | 0:af296e7fa008 | 18 | } |
| sjsvarma | 0:af296e7fa008 | 19 | i++; |
| sjsvarma | 0:af296e7fa008 | 20 | } |
| sjsvarma | 0:af296e7fa008 | 21 | } |
| sjsvarma | 0:af296e7fa008 | 22 | } |
