4.7 LED mittels Tastendruck ein- und ausschalten. (if/else, AnalogIn) mit Berücksichtigung Poti (PWM)
Dependencies: mbed
Fork of 04-02-Uebung by
Diff: main.cpp
- Revision:
- 0:03cf1f3b043c
- Child:
- 1:60535236bc87
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Feb 20 18:47:52 2015 +0000 @@ -0,0 +1,18 @@ +/** 4.2 LED mittels Tastendruck ein- und ausschalten. (if/else) +*/ +#include "mbed.h" + +DigitalIn b1( PTC9, PullUp ); +DigitalIn b2( PTC0, PullUp ); +DigitalOut led( D10 ); + +int main() +{ + while (true) + { + if ( b1 == 0 ) + led = 1; + if ( b2 == 0 ) + led = 0; + } +} \ No newline at end of file