Advertisement
computermuseo

led microphone control arduino

Apr 16th, 2015
3,379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. int sensorPin = A0; // select the input pin for the potentiometer
  2. int ledPin = 13; // select the pin for the LED
  3. int sensorValue = 0; // variable to store the value coming from the sensor
  4.  
  5. void setup ()
  6. {
  7. pinMode (ledPin, OUTPUT);
  8. Serial.begin (9600);
  9. }
  10.  
  11. void loop ()
  12. {
  13. Serial.print (A0);
  14. sensorValue = analogRead (sensorPin);
  15. digitalWrite (ledPin, HIGH);
  16. delay (sensorValue);
  17. digitalWrite (ledPin, LOW);
  18. delay (sensorValue);
  19. Serial.println (sensorValue, DEC);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement