MandyRae

Arduino Candle Snuffer Code

Aug 18th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. //Arduino Candle Snuffer
  2. //Extremely simple code
  3. //See images of the candle snuffer at
  4.  
  5. const int FAN = 4;
  6. const int BUTTON1 = 2;
  7.  
  8. void setup(){
  9.   pinMode(FAN, OUTPUT);
  10.   pinMode(BUTTON1, INPUT);
  11. }
  12.  
  13. void loop(){
  14.   while (digitalRead(BUTTON1)==LOW){
  15.     digitalWrite(FAN, HIGH);
  16.   }
  17.   digitalWrite(FAN, LOW);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment