A simple program to control the color of RGB LED.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:e04286461404
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Dec 18 13:33:02 2014 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" + +PwmOut red(p23); +PwmOut green(p24); +PwmOut blue(p25); + +AnalogIn pot1(p19); +AnalogIn pot2(p20); + +DigitalIn center(p14); // joystick center + +int main() { + while(1) { + red = 1 - pot1; + green = 1 - pot2; + blue = 1 - center; + } +} \ No newline at end of file