fixed lag
This commit is contained in:
parent
40e6157eb2
commit
76a19b64a7
1 changed files with 17 additions and 14 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# SPDX-FileCopyrightText: 2021 John Park for Adafruit Industries
|
||||
# SPDX-FileCopyrightText: 2022 John Park for Adafruit Industries
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Macropad MIDI Tester
|
||||
# Play MIDI notes with keys
|
||||
|
|
@ -10,6 +10,7 @@ from rainbowio import colorwheel
|
|||
CC_NUM = 74 # select your CC number
|
||||
|
||||
macropad = MacroPad(rotation=180) # create the macropad object, rotate orientation
|
||||
macropad.display.auto_refresh = False # avoid lag
|
||||
|
||||
# --- Pixel setup --- #
|
||||
key_color = colorwheel(120) # fill with cyan to start
|
||||
|
|
@ -38,8 +39,8 @@ last_knob_pos = macropad.encoder # store knob position state
|
|||
|
||||
|
||||
while True:
|
||||
|
||||
key_event = macropad.keys.events.get() # check for key press or release
|
||||
while macropad.keys.events: # check for key press or release
|
||||
key_event = macropad.keys.events.get()
|
||||
if key_event:
|
||||
if key_event.pressed:
|
||||
key = key_event.key_number
|
||||
|
|
@ -91,3 +92,5 @@ while True:
|
|||
text_lines[0].text = ("Mode: %s %d" % (mode_text[mode], midi_values[mode]-8))
|
||||
|
||||
last_knob_pos = macropad.encoder
|
||||
|
||||
macropad.display.refresh()
|
||||
|
|
|
|||
Loading…
Reference in a new issue