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: EthernetInterfacePlusHostname RdWebServer mbed-rtos mbed
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
Generated on Wed Jul 13 2022 23:44:38 by
1.7.2