Spidey Wall is the name for a physical wall lit up by multiple addressable LED strips. This program is an LPC1768 web server to control the wall from a browser.

Dependencies:   EthernetInterfacePlusHostname RdWebServer mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ledstrip.h Source File

ledstrip.h

00001 #ifndef LEDSTRIP__H
00002 #define LEDSTRIP__H
00003 
00004 // LED Strip using WS2801 with two ISRs for two SPI connected 
00005 // LED strips running in parallel
00006 // Rob Dobson 2013-2014
00007 
00008 #include "mbed.h"
00009 
00010 class ledstrip
00011 {
00012     private:
00013         unsigned char* mpLedValuesA;
00014         unsigned char* mpLedValuesB;
00015         unsigned char* mpCurLedValues;
00016         int mLedsInStrip;
00017         int mSplitPoint;
00018         int mLedsBufSize;
00019         SPI* mpSPI0;
00020         SPI* mpSPI1;
00021         
00022     public:
00023         static const int mColoursPerLed = 3;
00024 
00025     public:
00026         ledstrip(int length, int splitPoint);
00027         ~ledstrip();
00028         unsigned char* GetBuffer();
00029         int GetBufferSizeinBytes();
00030         bool Resize(int length, int splitPoint);
00031         bool IsBusy();
00032         int GetNumLeds()
00033         {
00034             return mLedsInStrip;
00035         }
00036         void Clear();
00037         void RawFill(int startLed, int numLeds, const unsigned char* pLedVals);
00038         void HsvFill(int startLed, int numLeds, const unsigned char* pLedVals);
00039         void Fill(int startLed, int numLeds, 
00040                 int r1, int g1, int b1, 
00041                 int r2, int g2, int b2);
00042         void Fill(int startLed, int numLeds, 
00043                 int r1, int g1, int b1);
00044         void ShowLeds();
00045         
00046 };
00047 
00048 #endif