Go Down

Topic: Analog inputs are averaging? (Read 954 times) previous topic - next topic

robtillaart

Quote
????? Help ???

help!!

Analogports are A0 iso 0 and A1 iso 1

give this a try. Be aware that analog reads fluctuate ...
Code: [Select]

int loadcell;
int battery;

void setup()
{
 Serial.begin(9600);
}

void loop()
{
 loadcell = analogRead(A0);
 battery = analogRead(A1);
 Serial.print(loadcell);
 Serial.print(" ");
 Serial.println(battery);
 delay(100);
}
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Grumpy_Mike

Try this:-
Code: [Select]
void loop()
{
loadcell = analogRead(0);
loadcell = analogRead(0);
battery = analogRead(1);
battery = analogRead(1);
Serial.print(loadcell);
Serial.print(" ");
Serial.println(battery);
delay(100);
}

It will help if the impedance of each input is too high.

Go Up