A custom library to add simple functional calls for an AMT203 absolute rotary encoder manufactured by CUI Inc.
This library was built for use on the Arduino Uno (ATmega328P) development board which will act as a prototyping controller for the internal testing of various data acquisition projects.
-
Place the contained files within your working directory (where the .ino file is)
-
Add an inclusion header to your .ino file
#include "AMT203.h"
-
Initialize an AMT203 object with SPI communications arguments
AMT203 encoder(rotaryEncoderSCK, rotaryEncoderMOSI, rotaryEncoderMISO, rotaryEncoderCS, baudRate);
Call the newly defined object with the following functions as needed: (Copied from the header file, "AMT203.h")
void open(); >> Opens an SPI communications stream between the encoder and the Arduino
bool setZero(); >> Sets the current position of the encoder to "0" and future measurements will be an offset of this value
uint8_t command(uint8_t amtCommand); >> Sends a command of type 8-bit unsigned integer if you want to send a specific command directly to the encoder (unnecessary for normal operations)
uint16_t getPosition(); >> Returns the current position as the exact unsigned integer reported by the encoder
unoSensorIntegrate/ => Project sketch folder unoSensorIntegrate.ino => main Arduino file (example) AMT203.cpp => contains the functions for the AMT203 class AMT203.h => header file with function skeletons and necessary variables ReadMe.adoc => this file
To contribute to this project please contact hodgsonresearch https://id.arduino.cc/hodgsonresearch
The following have been used in this early phase of develoment to produce a partially-functional prototype of the final device. Only the rotational position is reported with this design.
ID |
Part name |
Part number |
Quantity |
E1 |
Encoder |
AMT203S-V |
1 |
A1 |
Arduino Uno |
A000066 |
1 |
This document is written in the AsciiDoc format, a markup language to describe documents. If you need help you can search the AsciiDoc homepage or consult the AsciiDoc cheatsheet