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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aind.Behavior.Amt10Encoder" Version="1.3.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aind.Behavior.Amt10Encoder" Version="1.3.6" />
                    
Directory.Packages.props
<PackageReference Include="Aind.Behavior.Amt10Encoder" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aind.Behavior.Amt10Encoder --version 1.3.6
                    
#r "nuget: Aind.Behavior.Amt10Encoder, 1.3.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aind.Behavior.Amt10Encoder@1.3.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aind.Behavior.Amt10Encoder&version=1.3.6
                    
Install as a Cake Addin
#tool nuget:?package=Aind.Behavior.Amt10Encoder&version=1.3.6
                    
Install as a Cake Tool

aind-behavior-amt10-encoder

License .NET Framework Bonsai

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:

  1. Open Bonsai
  2. Click on the "Tools" menu and select "Manage Packages"
  3. Click on "Settings" and add the NuGet package source where this package is hosted
  4. 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:

  1. Add an AMT10EncoderSource node to your Bonsai workflow
  2. Configure the PortName property to match your Arduino's serial port
  3. 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 port
  • BaudRate: 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:

  1. Ensure the Version property in src/Aind.Behavior.Amt10Encoder/Aind.Behavior.Amt10Encoder.csproj is updated to the desired new version.
  2. Commit and push any changes to the main branch.
  3. 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.

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 Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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