Routines to drive a chain of APA102 Leds.
Fork of APA102 by
A library to drive arrays of APA102 leds.
Diff: APA102a.h
- Revision:
- 4:2afea45fce8f
- Parent:
- 3:bf8c63d10824
- Child:
- 7:629583c31cef
diff -r bf8c63d10824 -r 2afea45fce8f APA102a.h --- a/APA102a.h Sat Mar 14 18:17:53 2015 +0000 +++ b/APA102a.h Sat Mar 14 20:45:03 2015 +0000 @@ -8,7 +8,7 @@ /** Create an APA102 Object */ - class APA102{ + class APA102a{ public: /** Create an APA102 object connected to the specified mosi,miso,sclk pins * @@ -17,7 +17,7 @@ * @param sclk : SPI Clock * @param rate : SPI Rate */ - APA102(PinName mosi,PinName miso,PinName sclk,int rate); + APA102a(PinName mosi,PinName miso,PinName sclk,int rate); /** Set the Buffer * @@ -45,8 +45,8 @@ * @param B : 8 bits of Blue (0,1,...,255) */ -int IRGB(unsigned char I,unsigned char R,unsigned char G,unsigned char B) { - return ((0xE0 + 0x1F&I)<<24)|((0xFF&R)<<16)|((0xFF&G)<<8)|(0xFF&B);} +unsigned int IRGB(unsigned char I,unsigned char R,unsigned char G,unsigned char B) { + return ((0xE0 + (0x1F&I))<<24)|((0xFF&R)<<16)|((0xFF&G)<<8)|(0xFF&B);} protected: