Reiko Randoja / RgbLedPCA9555

Dependents:   Telliskivi2_2014

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers rgb-led-pca9555.h Source File

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