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
Fork of LAB07_Oppgave2 by
Revision 1:2e42c8846b90, committed 2015-10-14
- Comitter:
- rlanghbv
- Date:
- Wed Oct 14 18:28:27 2015 +0000
- Parent:
- 0:78adfca8ca69
- Child:
- 2:a27126b6128e
- Commit message:
- first commit
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Sep 20 14:30:57 2015 +0000
+++ b/main.cpp Wed Oct 14 18:28:27 2015 +0000
@@ -1,25 +1,19 @@
#include "mbed.h"
+InterruptIn knapp(PB_3);
+
+BusOut leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4);
+static int teller=0;
+
-InterruptIn TachInput(PB_3);
+void knappTrykket(){
-BusOut Leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4);
-static int teller=0;
-
-void TachSensed()
-{ teller=teller+1;
+ teller=teller+1;
+ leds=~teller;
}
-int main()
-{
- TachInput.fall(&TachSensed);
-
- while (true)
- { teller=0;
- TachInput.enable_irq();
- wait_ms(1000);
- TachInput.disable_irq();
-
- Leds=~ ((1<< teller) -1);
- }
+int main(){
+ knapp.fall(&knappTrykket);
+ leds=~0;
+ while (true) { wait(1); }
}
\ No newline at end of file
