Hi Guys,
My current project is to monitor 2 batteries in a split charging system. I am displaying on a 20x4 display and currently have the temperature of each of the batteries displayed along with voltage and then charging current from the alternator to each of the batteries and the current being drawn from each of the batteries to devices.
What i am trying to do is display the 'difference' between the charging current to current draw to monitor wether the batteries are charging or dis-charging. I am using several int statements
int mid1 = mii1 - mio1; //Calculate difference in charging current to current draw main battery
mii1 being the curent flow to the battery and mio1 being current flow from the battery, all appears to be working well other than when the current draw is a minus number obviosly basic maths dictates 200 - -200 = 400 when acually i want it to equal zero, is there any way of being able to display this number as a nagative value? i may be being stupid but i cant see any way of achieving this.
Any help or advice would be apreciated.
thanks and best regards,
Phil