Colorduino plasma demo, matrix test and browser simulator
- ColorduinoPlasma sketch and Colorduino library v1.2.6 (lincomatic @ fff7bd3) - ColorduinoMatrixTest hardware test sketch - web/index.html: bit-accurate port of the plasma with large resolutions - prebuilt 16 MHz firmware (with and without Optiboot) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
a18f081e0a
15 files changed
+3103
No files matched your search
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
Colorduino 8x8 RGB matrix hardware test
|
||||
Needs the Colorduino library (lincomatic).
|
||||
|
||||
Sequence (loops forever):
|
||||
1. Full screen: RED, GREEN, BLUE, WHITE -> dead colour channel / driver (DM163)
|
||||
2. Rows one at a time (white) -> dead row driver (M54564)
|
||||
3. Columns one at a time, R then G then B -> dead column channel
|
||||
4. Every LED one by one, R, G, B each -> single dead / stuck LEDs
|
||||
5. Brightness ramp 0..255 per colour -> PWM / greyscale problems
|
||||
6. Checkerboard + inverse -> shorts between neighbours
|
||||
|
||||
Note: Colorduino drives all of PORTD, so Serial cannot be used while it runs.
|
||||
*/
|
||||
|
||||
#include <Colorduino.h>
|
||||
|
||||
const uint8_t W = ColorduinoScreenWidth;
|
||||
const uint8_t H = ColorduinoScreenHeight;
|
||||
|
||||
void show() { Colorduino.FlipPage(); }
|
||||
|
||||
void fill(uint8_t r, uint8_t g, uint8_t b) {
|
||||
Colorduino.ColorFill(r, g, b); // ColorFill flips the page itself
|
||||
}
|
||||
|
||||
void clearBuf() {
|
||||
for (uint8_t y = 0; y < H; y++)
|
||||
for (uint8_t x = 0; x < W; x++)
|
||||
Colorduino.SetPixel(x, y, 0, 0, 0);
|
||||
}
|
||||
|
||||
void fullColours() {
|
||||
fill(255, 0, 0); delay(1500);
|
||||
fill(0, 255, 0); delay(1500);
|
||||
fill(0, 0, 255); delay(1500);
|
||||
fill(255, 255, 255); delay(1500);
|
||||
fill(0, 0, 0); delay(300);
|
||||
}
|
||||
|
||||
void rowScan() {
|
||||
for (uint8_t y = 0; y < H; y++) {
|
||||
clearBuf();
|
||||
for (uint8_t x = 0; x < W; x++) Colorduino.SetPixel(x, y, 255, 255, 255);
|
||||
show();
|
||||
delay(400);
|
||||
}
|
||||
}
|
||||
|
||||
void columnScan() {
|
||||
const uint8_t cols[3][3] = {{255, 0, 0}, {0, 255, 0}, {0, 0, 255}};
|
||||
for (uint8_t c = 0; c < 3; c++) {
|
||||
for (uint8_t x = 0; x < W; x++) {
|
||||
clearBuf();
|
||||
for (uint8_t y = 0; y < H; y++)
|
||||
Colorduino.SetPixel(x, y, cols[c][0], cols[c][1], cols[c][2]);
|
||||
show();
|
||||
delay(250);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pixelWalk() {
|
||||
for (uint8_t y = 0; y < H; y++) {
|
||||
for (uint8_t x = 0; x < W; x++) {
|
||||
clearBuf(); Colorduino.SetPixel(x, y, 255, 0, 0); show(); delay(120);
|
||||
clearBuf(); Colorduino.SetPixel(x, y, 0, 255, 0); show(); delay(120);
|
||||
clearBuf(); Colorduino.SetPixel(x, y, 0, 0, 255); show(); delay(120);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ramps() {
|
||||
for (uint8_t c = 0; c < 4; c++) {
|
||||
for (int v = 0; v <= 255; v += 3) {
|
||||
uint8_t r = (c == 0 || c == 3) ? v : 0;
|
||||
uint8_t g = (c == 1 || c == 3) ? v : 0;
|
||||
uint8_t b = (c == 2 || c == 3) ? v : 0;
|
||||
fill(r, g, b);
|
||||
delay(12);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void checker() {
|
||||
for (uint8_t i = 0; i < 6; i++) {
|
||||
for (uint8_t y = 0; y < H; y++)
|
||||
for (uint8_t x = 0; x < W; x++) {
|
||||
bool on = ((x + y + i) & 1);
|
||||
Colorduino.SetPixel(x, y, on ? 255 : 0, on ? 255 : 0, on ? 255 : 0);
|
||||
}
|
||||
show();
|
||||
delay(500);
|
||||
}
|
||||
}
|
||||
|
||||
void setup() {
|
||||
Colorduino.Init();
|
||||
// white balance (R, G, B), 0..63 - same default as the Plasma example
|
||||
unsigned char whiteBal[3] = {36, 63, 63};
|
||||
Colorduino.SetWhiteBal(whiteBal);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
fullColours();
|
||||
rowScan();
|
||||
columnScan();
|
||||
pixelWalk();
|
||||
ramps();
|
||||
checker();
|
||||
}
|
||||
Reference in new issue
Block a user