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/
DrawingManager.cpp@3:e5ea80fae61d, 2015-08-31 (annotated)
- Committer:
- Bobty
- Date:
- Mon Aug 31 09:03:15 2015 +0000
- Revision:
- 3:e5ea80fae61d
- Parent:
- 2:99eb4c6e9ea4
- Child:
- 4:b521815f2657
Made ShowLeds an explicit command rather than automatic; Allow hostname to be set; Made sure HTTP response has keep-alive in it; Moved http_server into main loop (was in a separate thread); Added HSV fill command
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Bobty | 1:362331cec9b7 | 1 | // |
Bobty | 1:362331cec9b7 | 2 | // Drawing Manager for Pancake Drawbot |
Bobty | 1:362331cec9b7 | 3 | // Rob Dobson 2015 |
Bobty | 1:362331cec9b7 | 4 | // |
Bobty | 1:362331cec9b7 | 5 | |
Bobty | 1:362331cec9b7 | 6 | #include "DrawingManager.h" |
Bobty | 1:362331cec9b7 | 7 | #include "rtos.h" |
Bobty | 1:362331cec9b7 | 8 | |
Bobty | 2:99eb4c6e9ea4 | 9 | DrawingManager::DrawingManager() |
Bobty | 1:362331cec9b7 | 10 | { |
Bobty | 2:99eb4c6e9ea4 | 11 | pLedStrip = NULL; |
Bobty | 1:362331cec9b7 | 12 | isBusy = false; |
Bobty | 1:362331cec9b7 | 13 | } |
Bobty | 1:362331cec9b7 | 14 | |
Bobty | 2:99eb4c6e9ea4 | 15 | void DrawingManager::init(int numLeds, int splitPoint) |
Bobty | 1:362331cec9b7 | 16 | { |
Bobty | 2:99eb4c6e9ea4 | 17 | pLedStrip = new ledstrip(numLeds, splitPoint); |
Bobty | 2:99eb4c6e9ea4 | 18 | Thread::wait(100); |
Bobty | 2:99eb4c6e9ea4 | 19 | pLedStrip->Clear(); |
Bobty | 2:99eb4c6e9ea4 | 20 | pLedStrip->ShowLeds(); |
Bobty | 2:99eb4c6e9ea4 | 21 | |
Bobty | 1:362331cec9b7 | 22 | } |
Bobty | 1:362331cec9b7 | 23 | |
Bobty | 1:362331cec9b7 | 24 | char* DrawingManager::start(const unsigned char* cmdBuf, int cmdLen) |
Bobty | 1:362331cec9b7 | 25 | { |
Bobty | 2:99eb4c6e9ea4 | 26 | if (!pLedStrip) |
Bobty | 2:99eb4c6e9ea4 | 27 | return "NOINIT"; |
Bobty | 1:362331cec9b7 | 28 | if (isBusy) |
Bobty | 1:362331cec9b7 | 29 | return "BUSY"; |
Bobty | 1:362331cec9b7 | 30 | isBusy = true; |
Bobty | 1:362331cec9b7 | 31 | char* respStr = cmdmsg::Interpret(cmdBuf, cmdLen, pLedStrip); |
Bobty | 1:362331cec9b7 | 32 | isBusy = false; |
Bobty | 1:362331cec9b7 | 33 | return respStr; |
Bobty | 1:362331cec9b7 | 34 | } |
Bobty | 1:362331cec9b7 | 35 | |
Bobty | 1:362331cec9b7 | 36 | void DrawingManager::service() |
Bobty | 1:362331cec9b7 | 37 | { |
Bobty | 1:362331cec9b7 | 38 | } |