diff --git a/code/code_eigenbau.py b/code/code_eigenbau.py index 322eb43..f0af7c0 100644 --- a/code/code_eigenbau.py +++ b/code/code_eigenbau.py @@ -66,14 +66,15 @@ taste_ausgelöst = False colours = {0: (247, 253, 4), 1: (249, 178, 8), 2: (249, 132, 4), - 3: (252, 84, 4)} + 3: (252, 84, 4), + 4: (255,155,255)} # weiß # setze farben auf layer keys und den nutzbaren tasten nach dem start keybow.keys[0].set_led(*colours[0]) keybow.keys[1].set_led(*colours[1]) keybow.keys[2].set_led(*colours[2]) keybow.keys[3].set_led(*colours[3]) for n in nutzbare_tasten: - keybow.keys[n].set_led(255,155,255) + keybow.keys[n].set_led(*colours[4]) while True: # Always remember to call keybow.update()! @@ -85,35 +86,19 @@ while True: current_layer = 0 # färben zum layer gehörende tasten ein for n in nutzbare_tasten: - keybow.keys[n].set_led(*colours[current_layer]) - keybow.keys[0].set_led(*colours[current_layer]) - keybow.keys[1].set_led(255, 255, 255) - keybow.keys[2].set_led(255, 255, 255) - keybow.keys[3].set_led(255, 255, 255) + keybow.keys[n].set_led(*colours[4]) elif keys[1].pressed: current_layer = 1 for n in nutzbare_tasten: - keybow.keys[n].set_led(*colours[current_layer]) - keybow.keys[0].set_led(255, 255, 255) - keybow.keys[1].set_led(*colours[current_layer]) - keybow.keys[2].set_led(255, 255, 255) - keybow.keys[3].set_led(255, 255, 255) + keybow.keys[n].set_led(*colours[4]) elif keys[2].pressed: current_layer = 2 for n in nutzbare_tasten: - keybow.keys[n].set_led(*colours[current_layer]) - keybow.keys[0].set_led(255, 255, 255) - keybow.keys[1].set_led(255, 255, 255) - keybow.keys[2].set_led(*colours[current_layer]) - keybow.keys[3].set_led(255, 255, 255) + keybow.keys[n].set_led(*colours[4]) elif keys[3].pressed: current_layer = 3 for n in nutzbare_tasten: - keybow.keys[n].set_led(*colours[current_layer]) - keybow.keys[0].set_led(255, 255, 255) - keybow.keys[1].set_led(255, 255, 255) - keybow.keys[2].set_led(255, 255, 255) - keybow.keys[3].set_led(*colours[current_layer]) + keybow.keys[n].set_led(*colours[4]) # "frage" alle tasten ab for taste in layers[current_layer].keys():