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.
Dependencies: CalibrateMagneto QuaternionMath
Fork of SML2 by
LEDDriver.h
00001 #ifndef _H_LEDDRIVER_H 00002 #define _H_LEDDRIVER_H 00003 00004 #include "I2CPeripheral.h" 00005 00006 typedef uint32_t Color; // ARGB 00007 00008 namespace Colors 00009 { 00010 // 16 named colours 00011 const Color black = 0x000000; 00012 const Color gray = 0x808080; 00013 const Color silver = 0xC0C0C0; 00014 const Color white = 0xffffff; 00015 const Color maroon = 0x800000; 00016 const Color red = 0xff0000; 00017 const Color olive = 0x808000; 00018 const Color yellow = 0xffff00; 00019 const Color green = 0x008000; 00020 const Color lime = 0x00ff00; 00021 const Color teal = 0x008080; 00022 const Color aqua = 0x00ffff; 00023 const Color navy = 0x000080; 00024 const Color blue = 0x0000ff; 00025 const Color purple = 0x800080; 00026 const Color fuschia = 0xff00ff; 00027 00028 // aliases 00029 const Color deepred = maroon; 00030 const Color darkred = maroon; 00031 const Color cyan = aqua; 00032 const Color magenta = purple; 00033 const Color pink = fuschia; 00034 00035 // other colours 00036 const Color orange = 0xffa500; 00037 const Color slateblue = 0x6a5acd; 00038 }; 00039 00040 class LEDDriver : public I2CPeripheral 00041 { 00042 public: 00043 LEDDriver(I2C &i2c); 00044 void setOutputCurrent(float mA); 00045 void setColor(const Color color); 00046 void setColor(const float r, const float g, const float b); 00047 void setColor(const uint8_t r, const uint8_t g, const uint8_t b); 00048 void setWhiteLed(const float w); 00049 LEDDriver& operator=(const Color& c); 00050 }; 00051 00052 #endif//_H_LED_H
Generated on Wed Jul 13 2022 08:50:41 by
