Code for the MakeHaven roadsign control project. Code inside the portal/
folder is for the front end. The image conversion and sign update procedure will follow the method laid out in Image Upload.ipynb
. It works more or less like this:
- A user uploads an image or enters text in the front end site.
- The server runs a Python program to create a black-and-white version of the image or render the text as an image.
- The Python code stores the created image as a vector of 1's and 0's defined in a C header file
buf.h
. - The Python code then calls the Particle API to compile and update the Arduino source code of the Particle Electron controlling the sign. The source code it sends is a simple "boilerplate" code like
base.ino
orscroll.ino
. The image to display is "smuggled in" by having the code#include
thebuf.h
file. - The Arduino code handles the wacky bit shift conventions necessary to properly address the sign itself, meaning the Python code can export the image in a normal, left-to-right, top-to-bottom order.
Currently, the code is somewhat opaque and not well documented. My first goal in this fork is to improve that somewhat. Next I'm planning to try to write a program to process text inputs.
I've gotten the text rendering more or less working. It's all in the Text Upload.ipynb
file. Obviously, a final implementation is going to need to take the code in there and put it into python scripts for the server to execute, but that's OK...