SHARE
TWEET

Untitled

a guest Nov 15th, 2016 767 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //                //
  2. // D5 --/\/\/\---|>|--GND
  3. //
  4. //       100k   47uF
  5. // D2 --/\/\/\---||---GND
  6. //       100k   47uF
  7. // D3 --/\/\/\---||---GND
  8.  
  9. int brightness;
  10. void setup() {
  11.   // put your setup code here, to run once:
  12.   if(digitalRead(2)) {
  13.     if(digitalRead(3)) {
  14.       brightness = 5;
  15.     } else {
  16.       brightness = 40;
  17.       pinMode(3, OUTPUT);
  18.       digitalWrite(3, HIGH);
  19.     }
  20.   } else {
  21.     pinMode(2, OUTPUT);
  22.     digitalWrite(2, HIGH);
  23.     brightness = 255;
  24.   }
  25.   pinMode(5, OUTPUT);
  26.   analogWrite(5, brightness);
  27. }
  28.  
  29. void loop() {
  30.  
  31. }
RAW Paste Data
Top