Skip to content

Instantly share code, notes, and snippets.

@ThomasLengeling
Created August 29, 2015 20:22
Show Gist options
  • Save ThomasLengeling/9e1ad1ef00dcdcf4cd6d to your computer and use it in GitHub Desktop.
Save ThomasLengeling/9e1ad1ef00dcdcf4cd6d to your computer and use it in GitHub Desktop.
float promedio;
float value;
int counter = 0;
int numDatos = 50;
void loop(){
float inValue = analogRead(PIN);
promedio += inValue;
counter++;
if(counter == numDatos){
value = promedio / numDatos;
counter=0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment