First i am a rookie so please forgive me if the question is stupid...
I made a word clock using NANO with addressable RGB LEDs and sketch for clock works great.
I also added temperature DS18B20 brick sensor which should light up leds for words ''COLD'', ''HOT'', and ''WARM'' depending on temperature.
Here is the problem, if I add a line:
if (TempInC < 20) {
lightup(WordWARM, Black);
}
else {
lightup(WordWARM, Red);
}
This loop works fine.
As soon is I add color line for another word, for example COLD the sketch doesn't even start none of the LEDS light up and even reset button does nothing.
Example when sketch doesn't even start:
if (TempInC < 20) {
lightup(WordWarm, Black);
lightup(WordCold, Blue);
}
How are the colours and the WordWARM/WordCOLD variables defined/declared and what does the lightup() function do ? Does the code use arrays by any chance ?
The first thing that I would do is to declare all of the arrays as byte instead of int to save some memory and use the F() macro when printing constant strings to shift the use of memory
Serial.println(F("Arduino Digital Temperature // Serial Monitor Version")); //Print a message