Jump to content

What is the proper way to write this program?


gweempose

Recommended Posts

I want to write a program that will turn all my exterior lights on 15 minutes before sunset and turn them all off at sunrise. It seems like there are many ways to accomplish this. Would this work?

 

If

Sunset - 15 minutes to Sunrise (next day)

Then

Turn on front porch lights
Turn on dog run lights
Turn on patio lights

Else

Turn off front porch lights
turn off dog run lights
turn off patio lights

 

Or does it make more sense to have two separate programs. One to turn them on and the other to turn them off with no "else" statement?

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.3k
×
×
  • Create New...