Advertisement
inagantid20

Final Sound Sensor getting clap values code

Jun 29th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. //www.elegoo.com
  2. //2016.06.13
  3.  
  4. int sensorPin = A0; // select the input pin for the potentiometer
  5. //int ledPin = 13; // select the pin for the LED
  6. int sensorValue = 0; // variable to store the value coming from the sensor
  7.  
  8. void setup()
  9. {
  10. //pinMode(ledPin,OUTPUT);
  11. Serial.begin(9600);
  12. }
  13. void loop(){
  14. sensorValue = analogRead(sensorPin);
  15.  
  16. if(sensorValue > 58)
  17. {
  18.  
  19. Serial.println(sensorValue, DEC);
  20. delay(250);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement