Sensors - TAMSFormers5212/TAMSformers-Database GitHub Wiki
Not to be confused with their magnetic limit switch, Thriftybot's Analog Encoders can be used in conjucntion with a cyclindrical magnet glued into the shaft you are trying to control. These are used in our swerve modules with the housings designed for mk4 modules. Read the [Thriftybot Data Sheet] for more information.
These can be plugged into the ANALOG IN ports on the roborio. They have three pins, power, data, and ground, which match those on the roborio. You can also solder these onto a SparkMax breakout board, but we haven't done that before.
In code, you can create a AnalogEncoder or AnalogInput object to read the encoder's data.
code goes here
AnalogInput will give the pure voltage reading from the data pin, so you'll have to add more methods to convert that value to one that has meaning.
double getPosition(){
return m_analogInput.get
}
AnalogEncoder is simpler and converts that value for you. It also offers the ability to set an offset to the encoder, releasing you from the doing the math everytime yuo use the encoder value.
REV's Throughbore Encoder offers a form factor that fits into robot designs really well. Like the name suggests, the encoder housing goes on any hex shaft making it easy to use and install. [REV's data sheet] explains the several different ways to use it including two modes, absolute and relative, and three wiring methods that come included, 3 pin DIO port, 6 pin jst for SparkMax encoder port, and 4 pin jst. There are other wiring options which are more complicated.
2024 was our first year using one, and we used it as an absolute encoder wired through the DIO ports. There are three 3-pin pwm style wires that come out of the 6-pin jst that plugs into the encoder. The [REV documentation] explains each of the three, but we like to use the one for the duty cycle encoder as it can be easily accessed with the DutyCycle class.
[insert code here]
We haven't used them recently, so you'd have to search for the data sheets for these. They are likely wired through the DIO ports as they have three metal contacts and are just true/false buttons.