Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----------------------------------
- void setup()
- {
- Serial.begin(9600);
- }
- //-----------------------------------
- void loop()
- {
- const int LEITURAS = 200;
- long soma = 0;
- long media = 0;
- //int leitura = analogRead(A5);
- for (int i = 0; i < LEITURAS; i++)
- {
- int leitura = analogRead(A5);
- delay(2);
- soma += leitura;
- }
- media = soma / LEITURAS;
- Serial.println(media);
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement