treadmill#
Teensy treadmill encoder over USB-serial.
- Firmware Data Format:
With SHOW_MICROS defined:
"micros,distance(mm),speed(mm/s)"Without SHOW_MICROS:
"distance(mm),speed(mm/s)"
- Supported Commands:
- Command | Description |
|---------|———————————————-| | ‘?’ | Print version and header info | | ‘c’ | Initiate speed output calibration |
Built on mesofield.devices.base.BaseSerialDevice. Each parsed
line is recorded as a dict {"distance": float, "speed": float,
"device_us": int|None} so that the default
BaseDataProducer.save_data() writes a 4-column CSV
(timestamp,distance,speed,device_us).
The producer (EncoderSerialInterface) writes the CSV; the matching ingest-side parser (TreadmillSource) lives at the bottom of this module so producer and parser sit in the same file. EncoderSerialInterface.Parser resolves to TreadmillSource for manifest-driven dispatch.
- class mesofield.devices.treadmill.EncoderSerialInterface[source]#
Bases:
BaseSerialDeviceTeensy encoder/treadmill device.
Constructor accepts either a cfg dict (
BaseSerialDevice-style) or legacy positional/keyword args(port, baudrate)for backward compatibility withmesofield.hardware.- Parser#
alias of
TreadmillSource
- class mesofield.devices.treadmill.TreadmillSource[source]#
Bases:
TimeseriesSourceLoad treadmill samples aligned to the experiment window.