From d0cfaea14ae045c948c8fc955e12173c198f360d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Fri, 13 Dec 2024 22:24:27 +0100 Subject: [PATCH] added color saving MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- code.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code.py b/code.py index e6c5571..4c8478c 100644 --- a/code.py +++ b/code.py @@ -87,5 +87,6 @@ while True: # Save settings to non-volatile memory brightness_value = brightness_levels[brightness_index] - microcontroller.nvm[0:4] = f"{brightness_value:.2f}".encode() - microcontroller.nvm[4:5] = color_index.to_bytes(1, "little") + microcontroller.nvm[0:4] = f"{brightness_value:.2f}".encode() # Save brightness as a string (e.g., "0.80") + microcontroller.nvm[4:5] = color_index.to_bytes(1, "little") # Save color index as a single byte +