Required libraries and software packages
Software packages
Required Libraries
- Arduino
- ADNS 2160 optical sensor with SQUAL readout (based on the OptiMouse library)
- Stepper motor control
- Encoder
Libraries for alternative optical sensors
These are Optical motion sensor options with higher capabilities than the ADNS 2160. All of them use the SPI bus.
Arduino code examples
Closed_loop.ino
The closed loop example uses the optically measured angle increment as a setpoint for the proportional motor control. The animal controls the rotation of the platform.
Open_loop.ino
The Open loop example uses two user-defined variables (eg. 0-360 degrees) as setpoints to oscillate between at a user-defined interval.
Open_loop_SD.ino
Like the open loop example, but saving the different variables on the SD card on the Teensy 3.5 microcontroller. This program was used to record the accuracy and repeatability measurements.
Open_loop_moveAsync.ino
Like Open_loop_SD.ino, but instead of using the proportional control, rotation movement is controlled by the teensystep moveAsync() method, using a non-blocking trapezoidal profile.