Aan uit schakeling saxion opdracht 1.2
Dependencies: mbed
Revision 0:30ca94301688, committed 2018-03-10
- Comitter:
- lennartgroen
- Date:
- Sat Mar 10 09:30:05 2018 +0000
- Commit message:
- asd
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 Sat Mar 10 09:30:05 2018 +0000 @@ -0,0 +1,35 @@ +/* +Namen: Lennart Groen +Klas: EMT1PSa +Opdracht: Aan Uit schakeling +Samengewerkt met: ... +Datum: 10-03-2018 +Inspiratie uit: + +*/ + +#include <mbed.h> + +DigitalOut myled(LED1); +DigitalIn myswitch(USER_BUTTON); + + +int main() +{ + + int switchstate = 0; + + while(1){ + if (myswitch == 0 && switchstate == 0){ + myled = 1; + wait(myswitch == 1); + switchstate = 1; + } + else if (myswitch == 0 && switchstate == 1){ + myled = 0; + wait(myswitch == 1); + switchstate = 0; + } +} + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Mar 10 09:30:05 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/aa5281ff4a02 \ No newline at end of file