fixed some shit

Signed-off-by: Ebbe Baß <ebbe.bass>
main
Ebbe Baß 2024-06-02 13:42:12 +02:00
parent 79477c59e8
commit cc67b2b657
2 changed files with 8 additions and 2 deletions

View File

@ -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"
}
}

View File

@ -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