Analog-JST Board
Wiring and programming
The Axon Servo Analog-JST Board allows you to wire the analog output from "+" series servos without the need for custom wiring/adapters. Simply plug in the 3-pin analog output connector from up to two servos into the back of the board, and a 4 pin JST-PH wire from the front of the board to either of the analog ports on the REV Robotics Control or Expansion Hubs.
(The Analog ports are on the bottom right)

Expansion Hub Pinout (Photo from REV Robotics)
//get our analog input from the hardwareMap
AnalogInput analogInput = hardwareMap.get(AnalogInput.class, "myanaloginput");
// get the voltage of our analog line
// divide by 3.3 (the max voltage) to get a value between 0 and 1
// multiply by 360 to convert it to 0 to 360 degrees
double position = analogInput.getVoltage() / 3.3 * 360;
Last modified 2mo ago