SHARE
TWEET

smallsound

inventrkits Jan 22nd, 2020 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.   sensorValue = analogRead (sensorPin);
  14.   digitalWrite (ledPin, HIGH);
  15.   delay (sensorValue);
  16.   digitalWrite (ledPin, LOW);
  17.   delay (sensorValue);
  18.   Serial.println (sensorValue, DEC);
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top