|
Switch Test discussion
If you look closely at the flowchart and the resultant code you can see a problem caused if BOTH SWITCH1 and SWITCH2 are pressed.
There is no path or direction for this particular event. In fact, if SWITCH1 is pressed, the program always loops to the first option and never gets down to checking on SWITCH2.
You can have a try with the flow chart and fix up the problem by having a special event linked to both SWITCH1 AND SWITCH2 being pressed.
This is the AND option that can be easily placed into your TEXT based BASIC program.
The line is
if PUSH1 = 1 AND PUSH2 = 1 Then BothOn.
You have to add another subroutine called BothOn that has both lights in he ON state.
.
|