File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 1212import board
1313import displayio
1414from displayio_gauge import Gauge
15- from displayio_effects import throttle_effect
15+ from displayio_effects import fluctuation_effect
1616
1717display = board .DISPLAY
1818
2727main_group .append (bg_sprite )
2828display .show (main_group )
2929
30- throttle_effect . hook_throttle_effect (Gauge , "level" )
30+ fluctuation_effect . hook_fluctuation_effect (Gauge , "level" )
3131
3232my_gauge = Gauge (
3333 x = 90 ,
4141)
4242main_group .append (my_gauge )
4343
44- my_gauge .throttle_effect = 1
45- my_gauge .throttle_effect_move_rate = 0.01
44+ my_gauge .fluctuation_amplitude = 1
45+ my_gauge .fluctuation_move_rate = 0.01
4646
4747
4848while True :
4949
50- my_gauge .throttle_update ()
51- display .refresh ()
50+ my_gauge .update_fluctuation ()
Original file line number Diff line number Diff line change 44# SPDX-License-Identifier: Unlicense
55#############################
66"""
7- Use the random throttle effect for the Dial.
7+ Use the random fluctuation effect for the Dial.
88"""
99
1010import board
1111import displayio
1212import terminalio
1313from displayio_dial import Dial
14- from displayio_effects import throttle_effect
14+ from displayio_effects import fluctuation_effect
1515
1616# Fonts used for the Dial tick labels
1717tick_font = terminalio .FONT
2626maximum_value = 100
2727
2828# Hook in the throttle effect for the Dial widget
29- throttle_effect . hook_throttle_effect (Dial , "value" )
29+ fluctuation_effect . hook_fluctuation_effect (Dial , "value" )
3030
3131# Create a Dial widget
3232my_dial = Dial (
4949
5050display .show (my_group ) # add high level Group to the display
5151
52- # Set the dial to the value before turning on the throttle effect
52+ # Set the dial to the value before turning on the fluctuation effect
5353my_dial .value = 50
5454
55- my_dial .throttle_effect = 5 # Fluctuate at most "5" in either direction
56- my_dial .throttle_effect_move_rate = 0.1 # Fluctuate at "0.1 " per throttle_update()
55+ my_dial .fluctuation_amplitude = 5 # Fluctuate at most "5" in either direction
56+ my_dial .fluctuation_move_rate = 0.01 # Fluctuate at "0.01 " per throttle_update()
5757
5858while True :
5959
60- my_dial .throttle_update ()
61- display .refresh ()
60+ my_dial .update_fluctuation ()
You can’t perform that action at this time.
0 commit comments