I've never used functions before, and have tried to work through this example, but I'm not getting anything whatsoever printed in the monitor.
I have a humidity sensor attached to pin A0 (analogue pin).
Is there something obvious missing/wrong?
const int analogPin = A0;
void setup() {
// put your setup code here, to run once:
}
int ReadSens_and_Condition(){
int i;
int sval = 0;
for (i = 0; i < 5; i++){
sval = sval + analogRead(analogPin);
}
sval = sval / 5; // average
return sval;
}
void loop() {
int sens;
sens = ReadSens_and_Condition();
Serial.print("Average = ");
Serial.println(sens);
Serial.println ();
delay (10000);
}