change in mbed rtos library

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed-rtos mbed

Fork of rtos_basic by mbed official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RGB_LED.h Source File

RGB_LED.h

00001 #include "mbed.h"
00002 
00003 class RGBLed
00004 {
00005 public:
00006     RGBLed(PinName redpin, PinName greenpin, PinName bluepin);
00007     void write(float red,float green, float blue);
00008 private:
00009     PwmOut _redpin;
00010     PwmOut _greenpin;
00011     PwmOut _bluepin;
00012 };
00013  
00014 RGBLed::RGBLed (PinName redpin, PinName greenpin, PinName bluepin)
00015     : _redpin(redpin), _greenpin(greenpin), _bluepin(bluepin)
00016 {
00017     //50Hz PWM clock default a bit too low, go to 2000Hz (less flicker)
00018     _redpin.period(0.0005);
00019 }
00020  
00021 void RGBLed::write(float red,float green, float blue)
00022 {
00023     _redpin = red;
00024     _greenpin = green;
00025     _bluepin = blue;
00026 }
00027 //class could be moved to include file
00028  
00029  
00030 //Sestup RGB led using PWM pins and class