usb¶
Hardware that uses USB
Classes:
|
A continuously measured mouse wheel. |
|
-
class
Wheel
(mouse_idx=0, fs=10, thresh=100, thresh_type='dist', start=True, digi_out=False, mode='vel_total', integrate_dur=5)[source]¶ Bases:
autopilot.hardware.Hardware
A continuously measured mouse wheel.
Uses a USB computer mouse.
Warning
‘vel’ thresh_type not implemented
- Parameters
mouse_idx (int)
fs (int)
thresh (int)
thresh_type (‘dist’)
start (bool)
digi_out (
Digital_Out
, bool)mode (‘vel_total’)
integrate_dur (int)
Attributes:
Methods:
start
()check_thresh
(move)Updates thresh_val and checks whether it’s above/below threshold
calc_move
(move[, thresh_type])Calculate distance move depending on type (x, y, total dist)
assign_cb
(trigger_fn)Every hardware device that is a
trigger
must redefine this to accept a function (typicallyTask.handle_trigger()
) that is called when that trigger is activated.l_measure
(value)Task has signaled that we need to start measuring movements for a trigger
l_clear
(value)Stop measuring!
l_stop
(value)Stop measuring and clear system resources :Parameters: value ()
release
()Every hardware device needs to redefine release(), and must
-
input
= True¶
-
type
= 'Wheel'¶
-
trigger
= False¶
-
THRESH_TYPES
= ['dist', 'x', 'y', 'vel']¶
-
MODES
= ('vel_total', 'steady', 'dist', 'timed')¶
-
MOVE_DTYPE
= [('vel', 'i4'), ('dir', 'U5'), ('timestamp', 'f8')]¶
-
check_thresh
(move)[source]¶ Updates thresh_val and checks whether it’s above/below threshold
- Parameters
move (np.array) – Structured array with fields (‘vel’, ‘dir’, ‘timestamp’)
Returns:
-
calc_move
(move, thresh_type=None)[source]¶ Calculate distance move depending on type (x, y, total dist)
- Parameters
move ()
thresh_type ()
Returns:
-
assign_cb
(trigger_fn)[source]¶ Every hardware device that is a
trigger
must redefine this to accept a function (typicallyTask.handle_trigger()
) that is called when that trigger is activated.When not redefined, a warning is given.
-
class
Scale
(model='stamps.com', vendor_id=None, product_id=None)[source]¶ Bases:
autopilot.hardware.Hardware
Note
Not implemented, working on using a digital scale to make weighing faster.
- Parameters
model
vendor_id
product_id
Attributes:
-
MODEL
= {'stamps.com': {'product_id': 27251, 'vendor_id': 5190}}¶