I have got confused about where the sketch will return after calling a statement.
I have looked at the IfStatement section of the tutorial ( which incidentaly shows an LED connected to a pin with no resistor ! a 220 ohm res is mentioned in the parts list, but not on the Fritzing or the schematic )
I have made a sort of flowchart for a sketch I must write, simplified, I have if
( vtSense == HIGH ) { update () ;}some parts of the update statement refer a variable " timing " which is HIGH or LOW.
At the end of update () the sketch must continue to another statement called "checkclock ()"
If vtSense is LOW however , from the if function, I want it to set timing = LOW , and then carry on to the checkclock() statement.
I always assumed the "if" function would return to where it was called, which in this case would then set the timing LOW, which I dont want.
If I use an "else " for setting the timing LOW, would it skip this ?, it seems to be from this part of the tutorial which is talking about multiple tests
else can proceed another if test, so that multiple, mutually exclusive tests can be run at the same time.
Each test will proceed to the next one until a true test is encountered. When a true test is found, its associated block of code is run, and the program then skips to the line following the entire if/else construction.