M0Board_WF
/
WF_RGB_V1
a
Diff: main.cpp
- Revision:
- 0:19b982ea0416
diff -r 000000000000 -r 19b982ea0416 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jan 28 07:53:32 2015 +0000 @@ -0,0 +1,26 @@ +/*M0-BOARD LPC11U24 VERSION 1.0 WF 01_2015 +BULME Graz / Elektronik + +RGB - LED + +*/ + +#include "mbed.h" +PwmOut g(p5); // Definition LED grün, PWM +PwmOut b(p34); // Definition LED blau, PWM +PwmOut r(p36); // Definition LED rot, PWM +AnalogIn poti(p15); // Definition Analogeingang, POTI + +int main() +{ + r.period(0.001); // PWM-Periode = 1ms + while(1) + { + // ******************** Einlesen der Spg. Am Potentiometer + // ************ Wertebereich von g: 0 <= g <= 1, float + g=poti.read(); + b=1; // LED off + r=1; // LED off + wait (0.01); // ***** Warte 10ms + } +} \ No newline at end of file