#include "sketch_apr30a.h"
float fVin(unsigned int uiConvert) {
float fVolts;
fVolts = uiConvert; //Change to a float
fVolts = fVolts * (fVolts / 1023.0); // uiConvert Input is 0V - 5V
fVolts = (fVolts / 204.6) * 2.8; //
return fVolts;
}
/*---------------------------------------------------------------------------------------------------------------------------------------------*/
void setup() {
// declare the LedPin as an OUTPUT:
pinMode(LedPin, OUTPUT);
// declare relay pins as OUTPUT
pinMode(Relay1_pin4, OUTPUT);
pinMode(Relay2_pin5, OUTPUT);
}
/*---------------------------------------------------------------------------------------------------------------------------------------------*/
void loop()
{
// read the battery value from the sensors:
fBat_Bank1_Volts = analogRead(Bat_Bank1); //Read Battery Bank 1 Voltage
fBat_Bank1_Volts = fVin(fBat_Bank1_Volts);
}