Skip to content

Commit 782ca86

Browse files
committed
Renamed AnalogTrigger to Analog_trigger for consistency with other device names.
1 parent 2682820 commit 782ca86

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

source/pyControl/hardware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def __init__(
249249
self.triggers = triggers if triggers is not None else []
250250

251251
if threshold is not None: # For backward compatibility
252-
self.triggers.append(AnalogTrigger(threshold, rising_event, falling_event))
252+
self.triggers.append(Analog_trigger(threshold, rising_event, falling_event))
253253

254254
self.timer = pyb.Timer(available_timers.pop())
255255
if pin: # pin argument can be None when Analog_input subclassed.
@@ -362,7 +362,7 @@ def send_buffer(self, run_stop=False):
362362
fw.usb_serial.send(self.buffers[buffer_n])
363363

364364

365-
class AnalogTrigger(IO_object):
365+
class Analog_trigger(IO_object):
366366
# Generates framework events when an analog signal goes above or below specified threshold value.
367367

368368
def __init__(self, threshold, rising_event=None, falling_event=None):

tasks/example/running_wheel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from pyControl.utility import *
88
from devices import *
9-
from pyControl.hardware import AnalogTrigger
9+
from pyControl.hardware import Analog_trigger
1010

1111
# Variables.
1212

@@ -18,13 +18,13 @@
1818
v.give_bonus = False # Whether to give bonus reward.
1919
v.bonus_reward_duration = 50 * ms # Time to add to reward duration if bonus is earned.
2020

21-
running_trigger = AnalogTrigger(
21+
running_trigger = Analog_trigger(
2222
threshold=v.velocity_threshold,
2323
rising_event="started_running",
2424
falling_event="stopped_running",
2525
)
2626

27-
bonus_trigger = AnalogTrigger(
27+
bonus_trigger = Analog_trigger(
2828
threshold=v.bonus_velocity_threshold,
2929
rising_event="bonus_earned",
3030
)

0 commit comments

Comments
 (0)