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@0:ab7718445b3d, 2015-10-08 (annotated)
- Committer:
- Voldread
- Date:
- Thu Oct 08 16:12:24 2015 +0000
- Revision:
- 0:ab7718445b3d
Teller med leds
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Voldread | 0:ab7718445b3d | 1 | #include "mbed.h" |
| Voldread | 0:ab7718445b3d | 2 | |
| Voldread | 0:ab7718445b3d | 3 | BusOut Leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4); |
| Voldread | 0:ab7718445b3d | 4 | DigitalIn SW7(PB_3); |
| Voldread | 0:ab7718445b3d | 5 | DigitalIn SW6(PA_10); |
| Voldread | 0:ab7718445b3d | 6 | |
| Voldread | 0:ab7718445b3d | 7 | int main() |
| Voldread | 0:ab7718445b3d | 8 | { |
| Voldread | 0:ab7718445b3d | 9 | int teller=0; |
| Voldread | 0:ab7718445b3d | 10 | Leds=~teller; |
| Voldread | 0:ab7718445b3d | 11 | |
| Voldread | 0:ab7718445b3d | 12 | while (true) |
| Voldread | 0:ab7718445b3d | 13 | { |
| Voldread | 0:ab7718445b3d | 14 | if (SW7==0) |
| Voldread | 0:ab7718445b3d | 15 | { teller=teller+1; |
| Voldread | 0:ab7718445b3d | 16 | Leds=~teller; |
| Voldread | 0:ab7718445b3d | 17 | wait_ms(2); |
| Voldread | 0:ab7718445b3d | 18 | while(SW7==0){wait_ms(1);}; |
| Voldread | 0:ab7718445b3d | 19 | } |
| Voldread | 0:ab7718445b3d | 20 | if (SW6==0) |
| Voldread | 0:ab7718445b3d | 21 | { teller=teller-1; |
| Voldread | 0:ab7718445b3d | 22 | Leds=~teller; |
| Voldread | 0:ab7718445b3d | 23 | wait_ms(2); |
| Voldread | 0:ab7718445b3d | 24 | while(SW6==0){wait_ms(1);}; |
| Voldread | 0:ab7718445b3d | 25 | |
| Voldread | 0:ab7718445b3d | 26 | } |
| Voldread | 0:ab7718445b3d | 27 | } |
| Voldread | 0:ab7718445b3d | 28 | } |