Dual G2 High-Power Library

I am looking at the current calibration portion of the library. It seems like calibrateM1CurrentOffset() and calibrateM2CurrentOffset() are unnecessary (and therefore unused) because the functionality is handled by calibrateCurrentOffsets(). Am I missing something?


calibrateM1CurrentOffset() and calibrateM2CurrentOffset() can be used to calibrate a single motor channel (instead of both), which could be useful in certain cases (e.g. to record the voltage offset of motor 1 when motor 1 speed is 0, but motor 2 is in use). Alternatively, if you use calibrateCurrentOffsets() to calibrate the current offsets, it will record the offset for both motor channels, so you do not need to use the separate M1 and M2 functions.


Thanks Brandon. That makes sense. It raises one question in my mind that I think goes to my understanding of how the sensor works. If the offset can be determined at the outset (let’s say at startup on a battery powered robot), why would someone want to determine it later when one of the motors is running? Do the offsets move around a bit and need to be rechecked every now and then or is the offset reading for one motor different when another motor is running? Thanks.

Those functions just give you different options for calibrating. You should generally not need to keep re-calibrating.