🟢
Thrifty Absolute Encoder
  • 🤖Thrifty Absolute Encoder
  • Setup Guide
    • 🛠️Getting set up
      • 🧲Magnet Placement
      • 🎇Wiring
      • 💻Software
      • 🏋️Using with 3.3V
  • 💣Absolute Max Ratings
Powered by GitBook
On this page
  • Python
  • Java
  1. Setup Guide
  2. Getting set up

Software

Python

from wpilib import AnalogEncoder

analogPort = 0 # 0, 1, 2, 3
encoder = AnalogEncoder(analogPort)

print(encoder.getAbsolutePosition())

Java

public AnalogEncoder(AnalogInput analogInput) {
    m_analogInput = analogInput;
    init();
}

* Get the encoder value since the last reset.
   *
   * <p>This is reported in rotations since the last reset.
   *
   * @return the encoder value in rotations
   */
  public double get() {
    if (m_simPosition != null) {
      return m_simPosition.get();
    }
PreviousWiringNextUsing with 3.3V

Last updated 1 year ago

For more information, please see the .

🛠️
💻
WPILIB Repository