• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. Automate Your Porch Light > Understanding the Script

2.5. Understanding the Script

Unless your needs match mine exactly, you'll probably end up modifying the script to make it do what you want. There's a lot of code in that script, but the most interesting lines appear within the infinitely running while loop and the two subroutines. Everything before the while loop initializes variables, modules, and the serial port. This section of code contains variables that you may need to modify if you have used different house or unit codes:

	my $lights_hc = "B";
	my $porch_light_unit = "1";
	my $floodlight_unit = "2";
	my $interior_light_unit = "3";
	my $motion_hc = "C";


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint