From cc67b2b657e62d471522a7d71a6fedc849450f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sun, 2 Jun 2024 13:42:12 +0200 Subject: [PATCH] fixed some shit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- .vscode/settings.json | 7 +++++-- code.py | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index fccbd96..410188f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,10 @@ "python.analysis.extraPaths": [ "", "c:\\Users\\ebbe.bass\\.vscode\\extensions\\joedevivo.vscode-circuitpython-0.1.20-win32-x64\\stubs", - "c:\\Users\\ebbe.bass\\AppData\\Roaming\\Code\\User\\globalStorage\\joedevivo.vscode-circuitpython\\bundle\\20240326\\adafruit-circuitpython-bundle-py-20240326\\lib" + "c:\\Users\\ebbe.bass\\AppData\\Roaming\\Code\\User\\globalStorage\\joedevivo.vscode-circuitpython\\bundle\\20240602\\adafruit-circuitpython-bundle-py-20240602\\lib" ], - "circuitpython.board.version": null + "circuitpython.board.version": null, + "python.analysis.diagnosticSeverityOverrides": { + "reportMissingModuleSource": "none" + } } \ No newline at end of file diff --git a/code.py b/code.py index e718f0c..8dfeb4a 100644 --- a/code.py +++ b/code.py @@ -35,13 +35,16 @@ def interpolate_color(encoder_pos): fading_in_progress = False # Flag to indicate if fading animation is in progress + while True: enc_pos = encoder.position enc_pos = min(max(enc_pos, -25), 25) + print(enc_pos) # Process button press if not button.value and button_state is None: button_state = "pressed" + print("pressed") elif button.value and button_state == "pressed": lamp_state = not lamp_state # Toggle lamp state button_state = None # Reset button state