Advertisement
jpglickwebber

experiment2

Feb 5th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. int sensorPin = 0; // The potentiometer is connected to analog pin 0
  2. int ledPin = 13; // The LED is connected to digital pin 13
  3. void setup() // this function runs once when the sketch starts up
  4. {
  5. pinMode(ledPin, OUTPUT);
  6. }
  7. void loop() // this function runs repeatedly after setup() finishes
  8. {
  9. int
  10. sensorValue = analogRead(sensorPin);
  11. digitalWrite(ledPin, HIGH); // Turn the LED on
  12. delay(sensorValue); // Pause for sensorValue milliseconds
  13. digitalWrite(ledPin, LOW); // Turn the LED off
  14. delay(sensorValue); // Pause for sensorValue milliseconds
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement