Skip to content

Commit 27bd60f

Browse files
committed
Update example files
1 parent 4134d16 commit 27bd60f

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

examples/displayio_effects_gauge.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import board
1313
import displayio
1414
from displayio_gauge import Gauge
15-
from displayio_effects import throttle_effect
15+
from displayio_effects import fluctuation_effect
1616

1717
display = board.DISPLAY
1818

@@ -27,7 +27,7 @@
2727
main_group.append(bg_sprite)
2828
display.show(main_group)
2929

30-
throttle_effect.hook_throttle_effect(Gauge, "level")
30+
fluctuation_effect.hook_fluctuation_effect(Gauge, "level")
3131

3232
my_gauge = Gauge(
3333
x=90,
@@ -41,11 +41,10 @@
4141
)
4242
main_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

4848
while True:
4949

50-
my_gauge.throttle_update()
51-
display.refresh()
50+
my_gauge.update_fluctuation()

examples/displayio_effects_simpletest.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
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

1010
import board
1111
import displayio
1212
import terminalio
1313
from 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
1717
tick_font = terminalio.FONT
@@ -26,7 +26,7 @@
2626
maximum_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
3232
my_dial = Dial(
@@ -49,13 +49,12 @@
4949

5050
display.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
5353
my_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

5858
while True:
5959

60-
my_dial.throttle_update()
61-
display.refresh()
60+
my_dial.update_fluctuation()

0 commit comments

Comments
 (0)