daily pastebin goal
21%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Two Switch Blink
  2.      
  3.     int sensorPin = 2;               // select the input pin for the read
  4.     int ledPin = 13;                 // select the pin for the LED
  5.     int sensorValue = 0;             // variable to store the value coming from the sensor  
  6.  
  7.     void setup() {  
  8.     pinMode(ledPin, OUTPUT);        
  9.     Serial.begin(9600);
  10.   }
  11.  
  12.  
  13.     void loop(){
  14.     Serial.println(sensorValue);
  15.     sensorValue = analogRead(sensorPin);  // read the value from the sensor:    
  16.     digitalWrite(ledPin, HIGH);          
  17.     delay(sensorValue);                        
  18.     digitalWrite(ledPin, LOW);            
  19.     delay(sensorValue);                  
  20.      
  21.      
  22.      
  23.     }
RAW Paste Data
Top