A digital busy-board for young children. Launch and control a rocketship with zero fine motor skills!
Hi Everyone.
Because it sounds like fun (and also to help keep me motivated), I’m going to blog my project here. If you’d like to contribute or build along, I’d love the company .
Sounds like a great idea! That LED matrix makes me think of Tim’s efforts to diffuse and contain each LED in a matrix, could be worth a look for inspiration:
I did have a read of Tim’s LED Project when I was looking into glowbits. Tim’s attention to user interface, accessibility, and low barrier to entry is excellent. Making anything code-less is hard, particularly rendering.
Tim was in JavaScript so I’ll need to make my own rendering engine in C++. Does anyone know of a good Math Matrix/Vector library for Arduino?
I just need a simple way to add, subtract, limit, and multiply two vectors so I can get some simple euclidean animations going.
This is still in production and open source.
I’ll be blog as I go here, and will make a full tutorial when the finished project has been completed and debugged.
I expect to be completed in 6-12 weeks.
I’ve tested all my components. (thanks @Trent5487676)
I have working c++ classes for each of my components.
Joysticks are just pots with extra steps?
The hardest component to code up turned out to be the joystick.
It did eventually click for me when I read that it really was just two perpendicular pots. I ended up coding it that way and it worked.
I’ve also had quite some trouble with those fancy 3x4 Keypads. Admittedly I destroyed the first one while learning to solder so I’m taking the L on there. I’m still playing around with this library which I found on this article. It all seems legit, but I haven’t quite figured it out. I’ll come back to it later in the project after I’ve brought my moral back to acceptable.
Next Week
Next week I’m going to work on testing my code for multiple glowbit 8x8 matrix.
I’m planning on 4 8x8glowbits tiled in a square and I’ve written this fancy struct for handling the pixel logic. I’ve got the 4th and last glowbit coming probs next week and looking forward to debugging and testing images and animations at last.
struct Led64 {
CRGB matrix[64] = {};
};
struct Led256 {
CRGB matrix[256] = {};
};
struct QuadMatrix {
LedStrip<DISPLAYPIN_NW, LEDMATRIX_COUNT> NW;
LedStrip<DISPLAYPIN_NE, LEDMATRIX_COUNT> NE;
LedStrip<DISPLAYPIN_SW, LEDMATRIX_COUNT> SW;
LedStrip<DISPLAYPIN_SE, LEDMATRIX_COUNT> SE;
void drawTo(Led256 px) {
/* This func splits the 256 element array into 4 64 element arrays.
It devides the 16x16 square into 4 quadrents of 8x8: NW,NE,SW,SE Quadrants.
p and q allows us to clarify which array we need to push to.
The link below demonstrates the equation that converts the idecies correctly. https://www.desmos.com/calculator/4a8hztwpvy */
int xdim = LEDDISPLAY_XDIM;
int ydim = LEDDISPLAY_YDIM;
Led64 subMatrix[4] = {};
for (int j = 0; j < ydim; j++) {
for (int i = 0; i < xdim; i++) {
int idx = i + (j * ydim);
int subidx = (int)floor((((idx - 8) % 16) + idx) / 2) % 64;
int p = floor(i / 8);
int q = (floor(j / 8) + 1) * 2;
subMatrix[q + p - 2].matrix[subidx] = px.matrix[idx];
}
}
NW.drawTo(subMatrix[0].matrix);
NE.drawTo(subMatrix[1].matrix);
SW.drawTo(subMatrix[2].matrix);
SE.drawTo(subMatrix[3].matrix);
}
};
(This is maybe the part where a CE staff member politely informs me that they have already written a c++ glowbit library that handles this way better. I’m prepared to hear it; the truth will set me free).
Sorry we skimmed over your already-bolded question! I think I remember spending a while recalling a C++ maths library one of my maths lecturers mentioned, never got to it
Since you’re writing it in C++ on a fast Arduino, you’re already going to be quite fast, the only thing I’d recommend giving a look is the ARM CMSIS libraries, they are optimised for the Cortex chip in your Due, and have quite a few signal processing functions available: https://arm-software.github.io/CMSIS_5/DSP/html/index.html#intro
Since Glowbits are based on the common WS2812Bv5 LEDs, most of the regular suspects for the Arduino (FastLED etc), work just fine, and we mainly wanted to support the beginner-friendly nature of microPython. For an interesting dive, we’ve published videos on the challenges of getting speed out of microPython: https://youtu.be/zC-vDwFpGXU