This program compiled earlier with a do...while loop but now the compiler keeps calling "aver does not name a type". I declared it an integer. What's wrong with that. In addition I have a suspicion that it still will not do an average which is what I am trying to do. Can somebody give me a suggestion.
Thanks,
gary
int swb = A2;
int runtot = 0;
int count = 1;
int temp = 0;
int aver = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
for (count = 1; count < 100; count++)
temp = (analogRead(swb));
runtot = runtot + temp;
Serial.print("count ");
Serial.println(count);
Serial.print("Average ");
Serial.println(aver);
}
aver = runtot / count;
runtot = 0;
delay(2000);
}
Moderator edit:
</mark> <mark>[code]</mark> <mark>
</mark> <mark>[/code]</mark> <mark>
tags added.