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
This project is part of a Light-Wall using addressable LED strips (WS2801). I have published a few posts on my blog about the construction of the wall and building a game to play on it (PacMan). I have also had a guest post from a friend who has set his children the task of producing some interesting animations. The original post is http://robdobson.com/2015/07/spidey-wall/
So far, however, I hadn't fully connected the physical (and electronic) wall with the web-browser creations to drive it. This project is hopefully the final link. A fast and reliable web server using REST commands to drive the 1686 LEDs in the Spidey Wall from code running in a browser (say on an iPad while you are playing a game).
The approach taken here results in the ability to control the RGB values of all 1686 LEDs at a rate of 20 frames per second.
A blog post describing the whole thing is here:
http://robdobson.com/2015/08/a-reliable-mbed-webserver/
ledstrip.h@4:b521815f2657, 2015-08-31 (annotated)
- Committer:
- Bobty
- Date:
- Mon Aug 31 15:21:47 2015 +0000
- Revision:
- 4:b521815f2657
- Parent:
- 3:e5ea80fae61d
Tidied up and removed unnecessary code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Bobty | 0:887096209439 | 1 | #ifndef LEDSTRIP__H |
Bobty | 0:887096209439 | 2 | #define LEDSTRIP__H |
Bobty | 0:887096209439 | 3 | |
Bobty | 4:b521815f2657 | 4 | // LED Strip using WS2801 with two ISRs for two SPI connected |
Bobty | 4:b521815f2657 | 5 | // LED strips running in parallel |
Bobty | 4:b521815f2657 | 6 | // Rob Dobson 2013-2014 |
Bobty | 4:b521815f2657 | 7 | |
Bobty | 0:887096209439 | 8 | #include "mbed.h" |
Bobty | 0:887096209439 | 9 | |
Bobty | 0:887096209439 | 10 | class ledstrip |
Bobty | 0:887096209439 | 11 | { |
Bobty | 0:887096209439 | 12 | private: |
Bobty | 0:887096209439 | 13 | unsigned char* mpLedValuesA; |
Bobty | 0:887096209439 | 14 | unsigned char* mpLedValuesB; |
Bobty | 0:887096209439 | 15 | unsigned char* mpCurLedValues; |
Bobty | 0:887096209439 | 16 | int mLedsInStrip; |
Bobty | 0:887096209439 | 17 | int mSplitPoint; |
Bobty | 0:887096209439 | 18 | int mLedsBufSize; |
Bobty | 0:887096209439 | 19 | SPI* mpSPI0; |
Bobty | 0:887096209439 | 20 | SPI* mpSPI1; |
Bobty | 0:887096209439 | 21 | |
Bobty | 0:887096209439 | 22 | public: |
Bobty | 0:887096209439 | 23 | static const int mColoursPerLed = 3; |
Bobty | 0:887096209439 | 24 | |
Bobty | 0:887096209439 | 25 | public: |
Bobty | 0:887096209439 | 26 | ledstrip(int length, int splitPoint); |
Bobty | 0:887096209439 | 27 | ~ledstrip(); |
Bobty | 0:887096209439 | 28 | unsigned char* GetBuffer(); |
Bobty | 0:887096209439 | 29 | int GetBufferSizeinBytes(); |
Bobty | 0:887096209439 | 30 | bool Resize(int length, int splitPoint); |
Bobty | 0:887096209439 | 31 | bool IsBusy(); |
Bobty | 0:887096209439 | 32 | int GetNumLeds() |
Bobty | 0:887096209439 | 33 | { |
Bobty | 0:887096209439 | 34 | return mLedsInStrip; |
Bobty | 0:887096209439 | 35 | } |
Bobty | 0:887096209439 | 36 | void Clear(); |
Bobty | 1:362331cec9b7 | 37 | void RawFill(int startLed, int numLeds, const unsigned char* pLedVals); |
Bobty | 3:e5ea80fae61d | 38 | void HsvFill(int startLed, int numLeds, const unsigned char* pLedVals); |
Bobty | 0:887096209439 | 39 | void Fill(int startLed, int numLeds, |
Bobty | 0:887096209439 | 40 | int r1, int g1, int b1, |
Bobty | 0:887096209439 | 41 | int r2, int g2, int b2); |
Bobty | 0:887096209439 | 42 | void Fill(int startLed, int numLeds, |
Bobty | 0:887096209439 | 43 | int r1, int g1, int b1); |
Bobty | 0:887096209439 | 44 | void ShowLeds(); |
Bobty | 0:887096209439 | 45 | |
Bobty | 0:887096209439 | 46 | }; |
Bobty | 0:887096209439 | 47 | |
Bobty | 0:887096209439 | 48 | #endif |