Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. int LED1;
  2. float Sensor;
  3. int Light;
  4. float voltage_level;
  5. float analog_value;
  6.  
  7. void setup() {
  8. Serial.begin(9600);
  9. Sensor=A3;
  10. LED1=6;
  11. Sensor=A0;
  12. pinMode(LED1,OUTPUT);
  13.  
  14. }
  15.  
  16. void loop() {
  17. analog_value=analogRead(A3);
  18. if(analog_value<650.0)
  19. {analogWrite (LED1,random(100));
  20. delay (random(100));
  21. }
  22.  
  23. else
  24. {digitalWrite (LED1,LOW);
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement