File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Fruit_Jam/Fruit_Jam_Spell_Jam Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 4242# initialize Fruit Jam built-in hardware
4343fj = FruitJam ()
4444fj .neopixels .brightness = 0.1
45- fj .peripherals .volume = 9
45+ fj .peripherals .volume = 0.5
46+ vol_int = 50
4647
4748# AWS auth requires us to have accurate date/time
4849now = fj .sync_time ()
@@ -119,13 +120,13 @@ def say_and_spell_lastword():
119120 say_and_spell_lastword ()
120121 elif c .encode ("utf-8" ) == b"\x1b [B" :
121122 # down arrow
122- fj .peripherals .volume = max (1 , fj .peripherals .volume - 1 )
123+ vol_int = max (0 , vol_int - 5 )
124+ fj .peripherals .volume = vol_int / 100
123125 print (f"Volume: { fj .peripherals .volume } " )
124126 elif c .encode ("utf-8" ) == b"\x1b [A" :
125127 # up arrow
126- fj .peripherals .volume = min (
127- fj .peripherals .safe_volume_limit , fj .peripherals .volume + 1
128- )
128+ vol_int = min (fj .peripherals .safe_volume_limit * 100 , vol_int + 5 )
129+ fj .peripherals .volume = vol_int / 100
129130 print (f"Volume: { fj .peripherals .volume } " )
130131 else :
131132 print (f"unused key: { c .encode ('utf-8' )} " )
You can’t perform that action at this time.
0 commit comments