N1cls / Wordclock

GNU General Public License v3.0
22 stars 7 forks source link

Let the user decide from which corner the minutes start activating #10

Closed baumph closed 1 year ago

baumph commented 1 year ago

Hi! First of all thanks for this awesome project! I have only one minor thing that I would like to have changed. When selecting if the minutes count clockwise or counterclockwise I would like to set the first LED to start lighting. For example, I want the minute indicator in the top left to be illuminated first when going clockwise. Is a change like this possible? Thanks in advance!

AWSW-de commented 1 year ago

Hi, thanks for the nice words. =) Hmmm 🤔 I am not sure if I want to add this because this will cause some more changes than just the selection if I just think about this 3 minutes so far….

If you want to change the order you can simply change the code in the following section by changing the order of the LEDs 110 to 113:

// ########################################################################################################################################### // # Turns on the outer four LEDs (one per minute): // ########################################################################################################################################### void showMinutes(int minutes) { int minMod = (minutes % 5); for (int i = 1; i < 5; i++) { int ledNr = 0; if (switchLEDOrder) { // clockwise switch (i) { case 1: ledNr = 110; break; case 2: ledNr = 111; break; case 3: ledNr = 112; break; case 4: ledNr = 113; break; } } else { // anti clockwise switch (i) { case 1: ledNr = 113; break; case 2: ledNr = 112; break; case 3: ledNr = 111; break; case 4: ledNr = 110; break; } } if (minMod < i) pixels.setPixelColor(ledNr, pixels.Color(0, 0, 0)); else pixels.setPixelColor(ledNr, pixels.Color(redVal, greenVal, blueVal)); } }

baumph commented 1 year ago

@AWSW-de Thank you very much for this response. I now have the LEDs in the direction that I want to.