SHARE
TWEET

Untitled

a guest Jan 20th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int lightSensor = A1;
  2. int lightSensorValue;
  3. void setup() {
  4.   pinMode(10, OUTPUT);
  5.   pinMode(12, OUTPUT);
  6. }
  7.  
  8. void loop() {
  9.   lightSensorValue = analogRead(lightSensor);
  10.   if (lightSensorValue > 200)
  11.   {
  12.     digitalWrite(12, HIGH);
  13.     digitalWrite(10, HIGH);
  14.     delay(3000);
  15.     digitalWrite(10, LOW);
  16.     delay(2000);
  17.     digitalWrite(12, LOW);
  18.     delay(3000);
  19.     digitalWrite(10, HIGH);
  20.     delay(2000);
  21.     digitalWrite(12, LOW);
  22.     delay(3000);
  23.     digitalWrite(10, LOW);
  24.     delay(2000);
  25.     digitalWrite(12, HIGH);
  26.     delay(3000);
  27.   }
  28.   else
  29.   {
  30.     digitalWrite(10, HIGH);
  31.     digitalWrite(12, HIGH);
  32.     delay(500);
  33.   }
  34. }
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