int sensorValue = analogRead(A0); // the analog reading (which goes from 0 - 1023) weight measuring
AAAVal = constrain(sensorValue, 50, 200);// weight(step) value of an 'AAA' battery
AAVal = constrain(sensorValue, 210, 232);// weight(step) value of an 'AA' battery
CVal = constrain(sensorValue, 243, 289);// weight(step) value of a 'C' battery
DVal = constrain(sensorValue, 295, 360);// weight(step) value of a 'D' battery
If you are weighing one battery, you can't make decisions about how much 4 different types of batteries weigh. The constrain function is most certainly the wrong thing to be using here.