Well, I tried your code and same thing... I then defined battery_voltage in user_routines_fast and it's now updating, but the values are still in the 15 and 16000 range. I totally took out all the multiplication and stuff to get the normal volts and just created values using that equation so now I'm doing stuff like:
Code:
if (battery_voltage < 361)
{
relay02_fwd = 1 (<- this may be wrong, I'm writing this from memory)
}
The problem still remains: Why is my battery voltage appearing so high (like 600 volts)? I can't really see any relation. I may end up just making my own equation tomorrow or something that will allow me to get the voltage correct. Well, now I'm off to bed.
Edit: Just thought of another problem. My charger should stop charging when the value is greater than like 370 or something, but even though it's 16000, the charger remains on. I can connect the charger to a switch with the software and it works, so I'm probably screwing something up with the programming.