Advertisement
chillichump

Beginners Guide to Automation Episode 7

Feb 17th, 2020
595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. // youtube.com/chillichump2
  2.  
  3.  
  4. int pinOutput = 13;
  5. int delayOn = 5000;
  6. int delayOff = 30000;
  7.  
  8. void setup() {
  9.   Serial.begin(9600);
  10.   pinMode(pinOutput, OUTPUT);
  11.   Serial.print("Pin output is ");
  12.   Serial.println(pinOutput);
  13.   Serial.println("Beginning code...");
  14.  
  15. }
  16.  
  17. void loop() {
  18.   digitalWrite(pinOutput, HIGH);
  19.   Serial.println("Fan is on");
  20.   delay(delayOn);
  21.   digitalWrite(pinOutput, LOW);
  22.   Serial.println("Fan is off");
  23.   delay(delayOff);
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement