Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
RGBLed.h
00001 #ifndef RGBLED_H 00002 #define RGBLED_H 00003 00004 #include "PinNames.h" 00005 #include "mbed.h" 00006 00007 /** \brief A wrapper for an RGB LED connected to a PWM. This class simplifies the 00008 * setting of the color and also provides some basic color definitions. 00009 */ 00010 class RGBLed 00011 { 00012 public: 00013 RGBLed(PinName redPin, PinName greenPin, PinName bluePin); 00014 00015 /** \Brief Initialize the LED */ 00016 void init(); 00017 00018 /** \Brief Set the color of the RGB LED */ 00019 void setColor(const float red, const float green, const float blue); 00020 00021 private: 00022 PwmOut m_red; 00023 PwmOut m_green; 00024 PwmOut m_blue; 00025 }; 00026 00027 #endif
Generated on Mon Aug 1 2022 05:31:13 by
