Aind.Behavior.Amt10Encoder
1.3.6
dotnet add package Aind.Behavior.Amt10Encoder --version 1.3.6
NuGet\Install-Package Aind.Behavior.Amt10Encoder -Version 1.3.6
<PackageReference Include="Aind.Behavior.Amt10Encoder" Version="1.3.6" />
<PackageVersion Include="Aind.Behavior.Amt10Encoder" Version="1.3.6" />
<PackageReference Include="Aind.Behavior.Amt10Encoder" />
paket add Aind.Behavior.Amt10Encoder --version 1.3.6
#r "nuget: Aind.Behavior.Amt10Encoder, 1.3.6"
#:package Aind.Behavior.Amt10Encoder@1.3.6
#addin nuget:?package=Aind.Behavior.Amt10Encoder&version=1.3.6
#tool nuget:?package=Aind.Behavior.Amt10Encoder&version=1.3.6
aind-behavior-amt10-encoder
A Bonsai library for interfacing with AMT10 series quadrature encoders via Arduino.
Overview
This package provides nodes for reading and interacting with AMT10 quadrature encoders connected through an Arduino running the LS7366R_quadrature_counter firmware. The implementation follows the same protocol used in the Allen Institute's camstim library's AMT10_quadrature_encoder.py.
Installation
To install the aind-behavior-amt10-encoder package:
- Open Bonsai
- Click on the "Tools" menu and select "Manage Packages"
- Click on "Settings" and add the NuGet package source where this package is hosted
- Search for "aind.Behavior.Amt10Encoder" and install
Usage
Requirements
- Arduino board connected to the AMT10 encoder via LS7366R counter chip
- Arduino running the "LS7366R_quadrature_counter.ino" firmware (version v0.1.5 or later)
Key Components
- AMT10EncoderSource: Generates a continuous stream of encoder readings
- AMT10ResetEncoder: Resets the encoder counter to zero
Basic Workflow
[AMT10EncoderSource] --> [MemberSelector:Degrees] --> [LineGraph]
Example
See the examples directory for sample workflows:
- AMT10EncoderVisualizer.bonsai - Basic visualization of encoder position
- Add an
AMT10EncoderSource
node to your Bonsai workflow - Configure the
PortName
property to match your Arduino's serial port - Connect the node to visualization or data processing nodes
Configuration
AMT10EncoderSource Properties
PortName
: The name of the serial port (e.g., "COM3" on Windows or "/dev/tty.usbmodem1234" on macOS)BaudRate
: The baud rate for serial communication (default: 9600)Timeout
: The timeout for serial operations in milliseconds (default: 500)CountsPerRevolution
: The number of counts per revolution (default: 8192 for AMT10 encoders)Debug
: Enable/disable debug output from the Arduino
AMT10ResetEncoder Properties
PortName
: The name of the serial portBaudRate
: The baud rate for serial communication (default: 9600)Timeout
: The timeout for serial operations in milliseconds (default: 500)
Protocol Description
The extension communicates with an Arduino running the LS7366R_quadrature_counter firmware. The protocol consists of:
- Commands: Single-character commands sent to the Arduino (e.g., "2" to clear the encoder)
- Responses: Arduino responses in the format
;Index:123;Count:456
For details on the protocol implementation, see the reference Python implementation.
Deployment
This package is automatically deployed to NuGet.org via a GitHub Actions workflow when a new tag is created on the main
branch.
To trigger a deployment:
- Ensure the
Version
property insrc/Aind.Behavior.Amt10Encoder/Aind.Behavior.Amt10Encoder.csproj
is updated to the desired new version. - Commit and push any changes to the
main
branch. - Manually trigger the "Tag and Publish" workflow in the Actions tab of the GitHub repository.
- Set the "Publish to NuGet" input to
true
. - The workflow will:
- Read the version from the
.csproj
file. - Create a new Git tag in the format
v<version>
. - Build the project.
- Pack the NuGet package.
- Push the package to NuGet.org using the
NUGET_API_KEY
repository secret.
- Read the version from the
- Set the "Publish to NuGet" input to
Reference Implementation
This Bonsai extension is based on the Python implementation used in the Allen Institute's camstim software. The original code has been included in the reference directory for documentation purposes.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Bonsai.Core (>= 2.7.0)
- System.IO.Ports (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.3.6 | 94 | 5/30/2025 |