Trying to understand the logic of someone else's code

I recently made the following project, http://www.instructables.com/id/Arduino-WiFi-Garage-Door-Opener/?&sort=ACTIVE&limit=40#DISCUSS, and am trying to edit the initial behavior of the program but am having a hard time stepping through his code.

I was able to add a line of code in Webpages.cpp (rServer.print("<iframe src=‘http://Ip Address:Port#/view/view.shtml’ width=‘770’ height=‘560’’>"):wink: that is used for a network camera so I can see if the door is opened or closed.

What I would like to change next in the code, and I don’t know where to look, is to change it so when I initially enter the website (Webpages.cpp) that the ActivateGarageDoor() portion of the code in AccessControll.cpp is not triggered.

I’ve added several Serial.println statements throughout the code but haven’t been able to crack the code…

Post your code here. And please use the code button </> so your code looks like this

…R

I started putting his code in the post when I was walking through the code, but got turned around since there are about 16 different files that make up the project.

GarageDoorOpener2.zip (23.7 KB)

muldoon: about 16 different files that make up the project.

I hope someone else will help, but I'm too lazy to look at 16 files. Sorry.

...R

Your sketch appears to look like:

#include "EEPROM.h"
#include <EthernetClient.h>
#include <EthernetServer.h>
#include "Ethernet.h"
#include "SPI.h"

I can’t see how that accomplishes anything.

I also was wondering what that part of the code did... :)

muldoon: I also was wondering what that part of the code did... :)

The code you posted won't even compile, so, clearly, that is not the code you are really running.

Hi Paul.

On my computer, I verified that the code did compile; I did originally take out the IP address in the HardwareConfiguration.h file. But then I tried the exact same code on another computer and it did fail to compile because of the password information that was entered in from a different program... Evidently the code is somehow "locked" to a single computer? Oh well.

I messaged the author of the code, so hopefully he'll see and respond to it.

Thanks again!

A password to compile? Really?

PaulS:
Your sketch appears to look like:

#include "EEPROM.h"

#include <EthernetClient.h>
#include <EthernetServer.h>
#include “Ethernet.h”
#include “SPI.h”



I can't see how that accomplishes anything.

That sets up library paths. Everything else is in the .cpp (and .h) files. For example, Program.cpp has setup() and loop().

oqibidipo:

#include "EEPROM.h"

#include <EthernetClient.h>
#include <EthernetServer.h>
#include “Ethernet.h”
#include “SPI.h”




That sets up library paths. Everything else is in the .cpp (and .h) files. For example, Program.cpp has setup() and loop().

Yeah but the EEPROM, Ethernet and SPI libraries go in the project folder, suggesting that they are altered versions, not the standard ones while EthernetClient and EthernetServer (whaaa, on the SAME board?) libraries are in the IDE libraries folder.

Be wary that you get them right or if it compiles it has a high chance of being buggy.