Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Two Switch Blink
- int sensorPin = 2; // select the input pin for the read
- int ledPin = 13; // select the pin for the LED
- int sensorValue = 0; // variable to store the value coming from the sensor
- void setup() {
- pinMode(ledPin, OUTPUT);
- Serial.begin(9600);
- }
- void loop(){
- Serial.println(sensorValue);
- sensorValue = analogRead(sensorPin); // read the value from the sensor:
- digitalWrite(ledPin, HIGH);
- delay(sensorValue);
- digitalWrite(ledPin, LOW);
- delay(sensorValue);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement