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 12
12
import board
13
13
import displayio
14
14
from displayio_gauge import Gauge
15
- from displayio_effects import throttle_effect
15
+ from displayio_effects import fluctuation_effect
16
16
17
17
display = board .DISPLAY
18
18
27
27
main_group .append (bg_sprite )
28
28
display .show (main_group )
29
29
30
- throttle_effect . hook_throttle_effect (Gauge , "level" )
30
+ fluctuation_effect . hook_fluctuation_effect (Gauge , "level" )
31
31
32
32
my_gauge = Gauge (
33
33
x = 90 ,
41
41
)
42
42
main_group .append (my_gauge )
43
43
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
46
46
47
47
48
48
while True :
49
49
50
- my_gauge .throttle_update ()
51
- display .refresh ()
50
+ my_gauge .update_fluctuation ()
Original file line number Diff line number Diff line change 4
4
# SPDX-License-Identifier: Unlicense
5
5
#############################
6
6
"""
7
- Use the random throttle effect for the Dial.
7
+ Use the random fluctuation effect for the Dial.
8
8
"""
9
9
10
10
import board
11
11
import displayio
12
12
import terminalio
13
13
from displayio_dial import Dial
14
- from displayio_effects import throttle_effect
14
+ from displayio_effects import fluctuation_effect
15
15
16
16
# Fonts used for the Dial tick labels
17
17
tick_font = terminalio .FONT
26
26
maximum_value = 100
27
27
28
28
# 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" )
30
30
31
31
# Create a Dial widget
32
32
my_dial = Dial (
49
49
50
50
display .show (my_group ) # add high level Group to the display
51
51
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
53
53
my_dial .value = 50
54
54
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()
57
57
58
58
while True :
59
59
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