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:6d519aadd679, 2015-11-05 (annotated)
- Committer:
- ItaySharon
- Date:
- Thu Nov 05 12:16:34 2015 +0000
- Revision:
- 0:6d519aadd679
every time you click the user button it will blink 1 more time
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ItaySharon | 0:6d519aadd679 | 1 | #include "mbed.h" |
| ItaySharon | 0:6d519aadd679 | 2 | |
| ItaySharon | 0:6d519aadd679 | 3 | DigitalOut LED_1(LED1); |
| ItaySharon | 0:6d519aadd679 | 4 | DigitalIn USR_BTN(PC_13); |
| ItaySharon | 0:6d519aadd679 | 5 | |
| ItaySharon | 0:6d519aadd679 | 6 | int count = 1; |
| ItaySharon | 0:6d519aadd679 | 7 | |
| ItaySharon | 0:6d519aadd679 | 8 | int main() |
| ItaySharon | 0:6d519aadd679 | 9 | { |
| ItaySharon | 0:6d519aadd679 | 10 | while(1) { |
| ItaySharon | 0:6d519aadd679 | 11 | while(USR_BTN) { |
| ItaySharon | 0:6d519aadd679 | 12 | |
| ItaySharon | 0:6d519aadd679 | 13 | } |
| ItaySharon | 0:6d519aadd679 | 14 | for(int i = 0; i < count; i++) { |
| ItaySharon | 0:6d519aadd679 | 15 | LED_1 = 1; |
| ItaySharon | 0:6d519aadd679 | 16 | wait(0.2); |
| ItaySharon | 0:6d519aadd679 | 17 | LED_1 = 0; |
| ItaySharon | 0:6d519aadd679 | 18 | wait(0.2); |
| ItaySharon | 0:6d519aadd679 | 19 | } |
| ItaySharon | 0:6d519aadd679 | 20 | count++; |
| ItaySharon | 0:6d519aadd679 | 21 | while(!USR_BTN) { |
| ItaySharon | 0:6d519aadd679 | 22 | |
| ItaySharon | 0:6d519aadd679 | 23 | } |
| ItaySharon | 0:6d519aadd679 | 24 | } |
| ItaySharon | 0:6d519aadd679 | 25 | } |