Under RobotC, I wonder what is the difference between accessing quadrature encoders this or that way.
Suppose you have a motor on port2 with a quad encoder wired into dgtl1+dgtl2 and properly configured in the motor/sensor setup, including the linkage between the two. (I’ll use direct port names below instead of the configured aliases).
My students were using a mix of SensorValue[dgtl1], getMotorEncoder(motor2), resetMotorEncoder(motor2) and SensorValue[dgtl1]=0 and it was causing them some troubles that we traced to the discrepancies between read values (and/or the datalog reported values). They have since pretty much standardized on only accessing the SensorValue[port], since when not using built-in PID, the RobotC runtime doesn’t even need to know and shouldn’t care about the linkage.
I have seen some people around the net complaining to the same tune, so I wonder:
Is one accessing a different internal value than the other? How? Why?
Which approach is preferable? Why?