![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Øving 2
Dependencies: mbed
Revision 0:7fb8b1271036, committed 2017-09-05
- Comitter:
- olemh88
- Date:
- Tue Sep 05 13:36:50 2017 +0000
- Commit message:
- Oppgave 3A
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 7fb8b1271036 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 05 13:36:50 2017 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +DigitalIn bryter(p20); + + +int ny, gammel = 0; + +int main() +{ + while(1) { + ny = bryter; + if (ny == 1 && gammel == 0) { + myled = 1 - myled; + } + wait(0.05); + gammel = ny; + + } + +}
diff -r 000000000000 -r 7fb8b1271036 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Sep 05 13:36:50 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec \ No newline at end of file