add dreidel shake threshold

This commit is contained in:
caternuson 2019-12-12 08:16:47 -08:00
parent aa69401024
commit b928ae2ef9

View file

@ -5,6 +5,8 @@ import adafruit_imageload
from adafruit_circuitplayground.bluefruit import cpb
from adafruit_gizmo import tft_gizmo
SHAKE_THRESHOLD = 20
#pylint: disable=bad-continuation
# define melody to play while spinning (freq, duration)
melody = (
@ -56,7 +58,7 @@ splash.append(symbols_group)
tile = 0
while True:
# wait for shake
while not cpb.shake():
while not cpb.shake(shake_threshold=SHAKE_THRESHOLD):
pass
# play melody while "spinning" the symbols
for note, duration in melody: