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.
rgb-led-pca9555.h
00001 #ifndef RGBLEDPCA9555_H 00002 #define RGBLEDPCA9555_H 00003 00004 #include "mbed.h" 00005 #include "PCA9555.h" 00006 00007 class RgbLed { 00008 public: 00009 RgbLed(PCA9555 *ioExt, unsigned int redPin, unsigned int greenPin, unsigned int bluePin); 00010 00011 enum Color {RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW, WHITE, OFF}; 00012 void setColor(Color color); 00013 void setRed(bool ledState); 00014 void setGreen(bool ledState); 00015 void setBlue(bool ledState); 00016 void toggleRed(); 00017 void toggleGreen(); 00018 void toggleBlue(); 00019 void toggle(); 00020 00021 private: 00022 PCA9555 *extIO; 00023 unsigned int ledR; 00024 unsigned int ledG; 00025 unsigned int ledB; 00026 }; 00027 00028 #endif
Generated on Wed Jul 13 2022 20:25:29 by
1.7.2