kartonman

Thunder And Lightning Timer

Apr 4th, 2022 (edited)
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. /*
  2. Thunderstorm lightning controller. Starts as soon as power to controller is turned on.
  3. This sketch created and copywrite by Gary C. Granai https://www.facebook.com/gary.granai and is included in the
  4. Arduino For Model Railing Library at https://steamtraininfo.com/arduino-projects
  5. You are free to use this sketch and amend it for your own personal use as long as these credits remain intact. Using it in any manner or form for commercial purposes is prohibited.*/
  6. */
  7. #include <Wire.h>
  8. #define mofsetPin 2 // control pin for 5 volt mofset
  9.  
  10. void setup() {
  11. pinMode(mofsetPin, OUTPUT);}
  12. void loop() {
  13. thunder();
  14. delay(120000);
  15. nothunder();
  16. delay(180000);
  17. thunder();
  18. delay(880000);
  19. nothunder();
  20. delay(180000);
  21. thunder();
  22. delay(90000);
  23. nothunder();
  24. delay(120000);
  25. thunder();
  26. delay(880000);
  27. nothunder();
  28. delay(130000);
  29. }
  30.  
  31. //************************************************
  32. void thunder() {
  33. digitalWrite(mofsetPin, HIGH); // power up thunder and lighting boards through the mofset.
  34. }
  35. //*******************************
  36. void nothunder() {
  37. digitalWrite(mofsetPin, LOW);
  38. }
  39.  
  40.  
  41.  
Add Comment
Please, Sign In to add comment