Skip to content
Snippets Groups Projects
Commit f9f1c2fd authored by Jan Grewe's avatar Jan Grewe
Browse files

fix game settings still changing by themselves

parent 9ac7c488
Branches
No related tags found
No related merge requests found
...@@ -6,13 +6,13 @@ Preferences preferences; ...@@ -6,13 +6,13 @@ Preferences preferences;
void loadSettings() { void loadSettings() {
preferences.begin("settings", true); // true = readonly preferences.begin("settings", true); // true = readonly
defaultBrightness = preferences.getUInt("brightness", 50); defaultBrightness = (uint8_t)preferences.getUInt("brightness", 50);
gameInterval = preferences.getUInt("interval", 100); gameInterval = (uint16_t)preferences.getUInt("interval", 100);
colorMode = preferences.getUInt("color_mode", 0); // 0 = static, 1 = simple RGB, 2 = dynamic aging (decay) colorMode = (uint8_t)preferences.getUInt("color_mode", 0); // 0 = static, 1 = simple RGB, 2 = dynamic aging (decay)
colorDecay = preferences.getUInt("color_decay", 5); colorDecay = (uint8_t)preferences.getUInt("color_decay", 5);
colorR = preferences.getUInt("color_r", 255); colorR = (uint8_t)preferences.getUInt("color_r", 255);
colorG = preferences.getUInt("color_g", 255); colorG = (uint8_t)preferences.getUInt("color_g", 255);
colorB = preferences.getUInt("color_b", 255); colorB = (uint8_t)preferences.getUInt("color_b", 255);
preferences.end(); preferences.end();
displayBrightness(defaultBrightness); displayBrightness(defaultBrightness);
setGameColor(colorR, colorG, colorB); setGameColor(colorR, colorG, colorB);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment