Alexander De Geeter
/
RGB-LED
voor rian
Diff: lib/rgb.cpp
- Revision:
- 0:ff4d23667e75
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/rgb.cpp Fri Oct 23 08:36:18 2015 +0000 @@ -0,0 +1,15 @@ +#include "rgb.h" + + +Rgb::Rgb(PinName r_pin, PinName g_pin, PinName b_pin) { + + rout = new PwmOut(r_pin); + gout = new PwmOut(g_pin); + bout = new PwmOut(b_pin); +} + +void Rgb::setColor(int red, int green, int blue) { + rout->write(255-red); + gout->write(255-green); + bout->write(255-blue); +} \ No newline at end of file