Chile Monolith¶
Before I finish the programming of the Monolith, I want this september make something for my partner who is from Chile and this Month is “Fiestas Patrias” make a little mod of the Monolith.
Concept¶
The idea is that the Monolith shows red white and blue, colors of the Chilean flag (and other places) and play with that. In this case that if you press the button you pause the face you pause the rhythm and if you press again it resumes. Simple but fancy.
Programming.¶
I fork the work I’ve done with the Monolith so I have the same structure. First this is how the palette is going to be made with the fastled library:
void setupMoodPalette() {
// 'black out' all 16 palette entries...
fill_solid( palette, 16, CRGB::Black);
// decide if this is going to be 1/2/3 colours palete + black
palette[0] = CRGB::White;
palette[2] = CRGB::Red;
palette[4] = CRGB::Blue;
palette[8] = CRGB::White;
palette[10] = CRGB::Red;
palette[12] = CRGB::Blue;
palette1 = palette;
palette2 = palette;
palette3 = palette;
palette4 = palette;
palette5 = palette;
palette6 = palette;
palette7 = palette;
}
I put the colours twice because the palette has 16 colours and I want it to shine more than whith the mysterious standard Monolith.
I have 7 palettes structures and I’m keeping it but I change the base one.
I also added a new booleans variables. “continueFace1” up to 7 to flag if the beat is paused or not. And in the loop function where I have this:
for( int i = 0; i < NUM_LEDS1; i++) { //9948
leds1[i] = ColorFromPalette(palette1, gHue+(i*2), beat-gHue+(i*10));
}
I set this:
if (continueFace1){
for( int i = 0; i < NUM_LEDS1; i++) { //9948
leds1[i] = ColorFromPalette(palette1, gHue+(i*2), beat-gHue+(i*10));
}
}
For each face. I also connect this to the button events.
In this function:
void onButtonClicked(pinid_t pin, bool heldDown)
I set this condition when a specific buttonPin is pressed
if (pin == BUTTON_PIN3) {
ws.textAll("t3");
palette3[1] = palette3[0];
if (continueFace3){
continueFace3 = false;
} else {
continueFace3 = true;
}
}
And it works. At least when I test with one of the faces.
Complications one of the faces in the shield is broken¶
I found that one of the faces is unsoldiered so it won’t work. And probably I will find more hardware problems. This is going to be a good way to fix things and make the Monolith more reliable.
For this I have to reasing the pins to a 8th face that I didn’t mount (it was an extra) so let’s find out if it works!
In this case I check the traces (luckyly they are numbered)
And trace where are the pins (led data and button input) that they are associated to the Face 1 and the face 2. Since, sigh I’m already using jumpers because the shield is not well designed, at least can take advantage of that and connect the jumpers to the proper pins. I didn’t have to touch a line of code to make it work!