Hi,
I was reading over this instructable:http://www.instructables.com/id/Tankbot-Internet-Controlled-Tank-Robot/step4/Tank-Load-Code/
and came across this code: http://www.instructables.com/files/orig/FLU/K0YM/H0K52XTJ/FLUK0YMH0K52XTJ.ino
I don't quite understand how he is measure the amount of current the motors are pulling. The code is below, but I don't understand how it is working, nor do I understand what sensA and sensB would be connected to. Can someone please clarify?
void ampCheck() { //Check to see how much power we are pulling, shut down if we pull more than 2A
ampA=0;
ampB=0;
for (int i=0; i < 25; i++) {
ampA=ampA + analogRead(sensA);
ampB=ampB + analogRead(sensB);
delay(5);
}
ampA=(ampA/25);
ampB=(ampB/25);
if (ampA > 1000 || ampB > 1000) {
analogWrite(motorA, 0);
analogWrite(motorB, 0);
delay(1000);
}
}