Yo...
walking through the code, too much of a load, wot's it all mean:
hey - wot does this code do in ardumower:
pow cheers!
tomDW
walking through the code, too much of a load, wot's it all mean:
hey - wot does this code do in ardumower:
Code:
// ---- odometry (interrupt) --------------------------------------------------------
// odometryState: 1st left and right odometry signal
// odometryState2: 2nd left and right odometry signal (optional two-wire encoders)
void setOdometryState(unsigned long timeMicros, boolean odometryLeftState, boolean odometryRightState, boolean odometryLeftState2, boolean odometryRightState2){
if (odometryLeftState != odometryLeftLastState){
if (odometryLeftState){
if (!odometryLeftState2) odometryLeft++; else odometryLeft--;
}
odometryLeftLastState = odometryLeftState;
}
if (odometryRightState != odometryRightLastState){
if (odometryRightState){
if (!odometryRightState2) odometryRight++; else odometryRight--;
}
odometryRightLastState = odometryRightState;
}
if (odometryRightState2 != odometryRightLastState2){
odometryRightLastState2 = odometryRightState2;
}
if (odometryLeftState2 != odometryLeftLastState2){
odometryLeftLastState2 = odometryLeftState2;
}
}
pow cheers!
tomDW