update arduino/Betas/RGB_V1.1.1/main/main.ino.
parent
ba46b9f492
commit
40b2366ff7
|
@ -1232,20 +1232,20 @@ void addGlitter( fract8 chanceOfGlitter)
|
||||||
|
|
||||||
double return_voltage_value(int pin_no)
|
double return_voltage_value(int pin_no)
|
||||||
{
|
{
|
||||||
double tmp = 0;
|
double tmp;
|
||||||
double ADCVoltage = 0;
|
double ADCVoltage;
|
||||||
double inputVoltage = 0;
|
double inputVoltage;
|
||||||
|
|
||||||
for (int i = 0; i < 20; i++)
|
for (int i = 0; i < 20; i++)
|
||||||
{
|
{
|
||||||
ADCVoltage = analogReadMilliVolts(pin_no) / 1000;
|
ADCVoltage = analogReadMilliVolts(pin_no) / 1000.0;
|
||||||
inputVoltage = (ADCVoltage * R1_VOLTAGE) / R2_VOLTAGE;
|
inputVoltage = (ADCVoltage * R1_VOLTAGE) / R2_VOLTAGE;
|
||||||
|
|
||||||
tmp = tmp + inputVoltage + ADCVoltage; // formula for calculating voltage in i.e. GND
|
tmp = tmp + inputVoltage + ADCVoltage; // formula for calculating voltage in i.e. GND
|
||||||
}
|
}
|
||||||
inputVoltage = tmp / 20;
|
inputVoltage = tmp / 20;
|
||||||
if(inputVoltage!=0)
|
if(inputVoltage!=0)
|
||||||
inputVoltage = inputVoltage + 0.165;
|
inputVoltage = inputVoltage + 0.001;
|
||||||
|
|
||||||
return inputVoltage;
|
return inputVoltage;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue