Ø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 |
--- /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; + + } + +}
--- /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