I’ve sent this off to REV support as well but maybe someone in the CD community has an insight.
Was looking to use the Through Bore Encoder on this years FRC robot so I plugged in the supplied cable to the unit and the other end, the one with the Black, Red and White Cable into DIO port 0 of the RoboRio.
Using instructions from here…
I wrote essentially two lines of code into a TimedRobot template.
In robot INIT I made a new encoder
DutyCycleEncoder encoder = new DutyCycleEncoder(0);
In RobotPeriodic wrote the “.isConnected” and .getAbsolutePosition to the smartdashboard.
The functions are all working as the debug session showing the lines of code being executed.
.isConnected always returns false.
I tested this with two different hardware units.
Switch is in the “A” position.
Thanks for pointing out any pitfalls I’m unaware of.
Not sure what to do next.
We also should test the other encoder that we have as well. Those have been bouncing around with the FTC supplies for a while now and I don’t know that they have ever been used or set up. If they have been used, I have no idea if they were set up right or if they were wired properly.
Yes, that is the cable. Switch is on “A” (again from memory when I checked last night).
Gonna try it connected direct to a SparkMax today.
Just didn’t know if anyone in CD land had one of these hooked up this way right now and it be working.
We used two last year, no problem. We did make our own cable, just because we needed it to be longer. We also use C++ and had our own code on top of the DutyCycle class though.
Maybe try calling .getFrequency() and printing that as well. And, I would advise against constructing this every loop iteration – construct it once and just do the prints in the loop.
I just double checked with a Rev through bore I’ve had for a few years, and its working fine. I wonder if theres a miswire in the connector. On the 6 pin side, what order are the pins? They should be
Good call. Problem Solved. Mis-wired cable from REV.
On closer examination they have the pigtails ground (black wire) all wired to a common wire, same for power (red wire) all wired to a common. Well, they swapped one of the red and blacks in the bundles so the whole cable is borked.