23 lines
433 B
Arduino
23 lines
433 B
Arduino
|
float getPanel(){
|
||
|
float value = mapfloat(average(PANEL), 409, 819, 0, 100);
|
||
|
if (value>0) {
|
||
|
return value; // %
|
||
|
}
|
||
|
else {
|
||
|
return 0; // %
|
||
|
}
|
||
|
}
|
||
|
|
||
|
float getBattery() {
|
||
|
|
||
|
float temp = average(BAT);
|
||
|
Serial.print("Battery mV: ");
|
||
|
Serial.println(temp*5000/1023);
|
||
|
Serial.println("*******************");
|
||
|
|
||
|
temp = mapfloat(temp, 613, 825, 0, 100);
|
||
|
if (temp>100) temp=100;
|
||
|
if (temp<0) temp=0;
|
||
|
return temp;
|
||
|
}
|