- Name
- MouseJoystickController
- Version
- 5.0.0
- License
- BSD
- URL
- https://github.com/janelia-arduino/MouseJoystickController
- Author
- Peter Polidoro
- [email protected]
Modular device mouse joystick controller library.
{
"id": "getApi",
"result": {
"ancestors": [
"ModularServer",
"ModularDeviceBase",
"StepDirController",
"StepperController",
"StageController"
],
"firmware": [
{
"name": "MouseJoystickController",
"version": "5.0.1"
}
],
"verbosity": "NAMES",
"functions": [
"getSet",
"clearSet",
"getBlockCount",
"addBlockToSet",
"startAssay",
"getAssayStatus",
"moveJoystickToBasePosition",
"moveJoystickToReachPosition",
"activateLickport",
"getTrialTimingData"
],
"parameters": [
"repeat_trial_count",
"pull_torque",
"lickport_reward_duration",
"zero_torque_reward_delay",
"reach_position",
"lickport_activation_duration",
"lickport_activation_count"
],
"properties": [
"homeCurrent",
"idleCurrent",
"basePosition",
"pullThreshold",
"pushThreshold",
"joystickReadyToneFrequency",
"joystickReadyToneDuration",
"rewardToneFrequency",
"rewardToneDuration",
"toneVolume",
"lickportRewardDelay",
"trialTimeoutDuration",
"repeatAbortedTrial",
"repeatSetCount",
"startTrialDuration",
"waitUntilTrialTimingDataRead"
],
"callbacks": [
"startTrial",
"abortTrial",
"abortAssay",
"restartAssay"
]
}
}
An assay consists of a series of trials, performed one after the other, until the assay is either completed successfully or is aborted.
The assay begins by calibrating each axis position by homing each axis to its home switch.
The joystick then moves to the base position and waits until a trial is started.
For each trial, the user sets the value for the joystick pull torque, the lickport reward duration, and the multiple axis joystick reach position.
When a trial is started, the joystick moves to the reach position and waits for the mouse to pull the joystick. The trial may be aborted by the user or it may be aborted automatically if the mouse pushes too far on the joystick or if the mouse waits longer than the trial timeout duration before pulling.
Three values are used for each trial, the pull_torque, the lickport_reward_duration, and the reach_position.
A block is a group of identical trials, repeated repeat_trial_count times.
{
"repeat_trial_count": 2,
"pull_torque": 50,
"lickport_reward_duration": 100,
"zero_torque_reward_delay": 3,
"reach_position": [
20,
200
]
}
A set is a group of blocks, run one after another. The set is repeated repeatSetCount times.
[
{
"repeat_trial_count": 2,
"pull_torque": 50,
"lickport_reward_duration": 100,
"zero_torque_reward_delay": 3,
"reach_position": [
20,
200
]
},
{
"repeat_trial_count": 3,
"pull_torque": 75,
"lickport_reward_duration": 120,
"zero_torque_reward_delay": 3,
"reach_position": [
30,
300
]
}
]
{
"state": "ASSAY_NOT_STARTED",
"unread_trial_timing_data": false,
"finished_trial_count": 0,
"successful_trial_count": 0,
"trial_aborted": false,
"assay_aborted": false,
"pull_threshold": -50,
"set_in_assay": 0,
"repeat_set_count": 2,
"block_in_set": 0,
"block_count": 1,
"trial_in_block": 0,
"block": {
"repeat_trial_count": 2,
"pull_torque": 50,
"lickport_reward_duration": 100,
"zero_torque_reward_delay": 3,
"reach_position": [
20,
200
]
}
}
{
"trial_start": 0,
"mouse_ready": 0,
"joystick_ready": 0,
"pull": 0,
"push": 0,
"timeout": 0,
"trial_abort": 0
}
https://github.com/janelia-arduino/ModularServer
https://github.com/janelia-arduino/ModularDeviceBase
https://github.com/janelia-arduino/StepDirController
https://github.com/janelia-arduino/StepperController
https://github.com/janelia-arduino/StageController
https://github.com/janelia-arduino/EncoderInterfaceSimple
https://github.com/janelia-arduino/PowerSwitchController
https://github.com/janelia-arduino/AudioController
https://github.com/janelia-modular-devices/modular_device_base
https://github.com/janelia-modular-devices/stepper_controller
https://github.com/janelia-modular-devices/encoder_interface_simple
https://github.com/janelia-modular-devices/power_switch_controller
https://github.com/janelia-modular-devices/audio_controller
https://github.com/janelia-modular-devices/modular-devices
https://github.com/janelia-arduino/arduino-libraries
https://github.com/janelia-arduino/MouseJoystickController.git
git clone https://github.com/janelia-arduino/MouseJoystickController.git
https://docs.platformio.org/en/latest/core/installation/index.html
python3 -m venv .venv
source .venv/bin/activate
pip install platformio
pio --version
Linux users have to install udev rules for PlatformIO supported boards/devices.
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
sudo service udev restart
sudo usermod -a -G dialout $USER
sudo usermod -a -G plugdev $USER
sudo apt-get purge --auto-remove modemmanager
make firmware
pio run -e teensy35
make upload
pio run -e teensy35 -t upload
make monitor
pio device monitor --echo --eol=LF