Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int soundPin = A0;
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- long sum = 0;
- for (int i = 0; i < 100; i++)
- {
- sum += analogRead(soundPin);
- }
- sum = sum/100;
- Serial.println(sum);
- delay(10);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement