Wouter ter Veldhuis
/
demofrdm_gpio
definitief
Revision 0:47611ee03ae7, committed 2016-09-12
- Comitter:
- WterVeldhuis
- Date:
- Mon Sep 12 09:58:31 2016 +0000
- Commit message:
- deze is goed
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 Mon Sep 12 09:58:31 2016 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" +DigitalOut gpo(D0); +DigitalOut ledR(LED_RED); +DigitalOut ledG(LED_GREEN); +DigitalOut ledB(LED_BLUE); +DigitalIn btn(SW3); +DigitalIn btn2(SW2); +float delay(0.8f); +int main() +{ + while(true) { + if(!btn && !btn2) { + ledR = false; + ledG = true; + ledB = true; + + } else if (!btn && btn2) { + ledR = true; + ledG = false; + ledB = true; + + } else if (btn && !btn2) { + ledR = true; + ledG = true; + ledB = false; + + } else { + ledR = true; + ledG = true; + ledB = true; + + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Sep 12 09:58:31 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/2e9cc70d1897 \ No newline at end of file