Skip to content

Used to test out the AS5145B encoder with the WPILIB Encoder class for incremental, quadrature input but can be used for any encoder with the wpilib

Notifications You must be signed in to change notification settings

manitourobotics/incremental-encoder-testing

Repository files navigation

This sample is used for testing the AS5145B encoder using a magnet on a motor shaft. The code simply dumps out information using class functions if the encoder is working correctly.

Wiring

Connect the A and B pin on the encoder to SIG pins on the digital IO on the digital sidecar. Connect both GND pins to two ground pins(-) on the digital IO on the digital sidecar. Connect the CSn pin to a ground pin (-) on the digital IO on the digital sidecar. Connect the 5V pin to a Power pin (PWR) on the digital IO on the digital sidecar

Requirements

  • CRIO & Sidecar
  • SmartDashboard
  • Lots and lots of wiring
  • A motor and a motorcontroller(may need to adjust the code to use your motor controller and PWM port of choice)
  • A calibrated magnet(comes with the encoder) fitted on a shaft

See the datasheet(source) for additional guidance.

About

Used to test out the AS5145B encoder with the WPILIB Encoder class for incremental, quadrature input but can be used for any encoder with the wpilib

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages