Hi smart people
My head hurts lol..... I have been at this for hours and I am over it (coding is not my forte)
Would someone be kind enough to type in the code to smooth out these 4 analogue inputs, as I am using this as a tool to balance throttle body vacuum over 4 ports, it would be nice to have a smoother data.
Thanks, mega appreciate your help
int minVoltage = 950;
int maxVoltage = 1050;
void setup() {
// put your setup code here, to run once:
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
void loop() {
// read the input on analog pin 1:
int sensorValue1 = analogRead(A1);
int sensorValue2 = analogRead(A2);
int sensorValue3 = analogRead(A3);
int sensorValue4 = analogRead(A4);
// Convert the analog reading (which goes from 1.3 - 4.7) to a preasure (800 - 1160):
float voltage1 = sensorValue1 * (4.59 / 3.4); // print out the value you read:
float voltage2 = sensorValue2 * (4.617 / 3.4); // print out the value you read:
float voltage3 = sensorValue3 * (4.60 / 3.4); // print out the value you read:
float voltage4 = sensorValue4 * (4.62 / 3.4); // print out the value you read:
Serial.print(minVoltage);
Serial.print(" ");
Serial.print(maxVoltage);
Serial.print(" ");
Serial.print(voltage1);
Serial.print(" ");
Serial.print(voltage2);
Serial.print(" ");
Serial.print(voltage3);
Serial.print(" ");
Serial.println(voltage4);
}
