Wednesday, February 16, 2011

Activity 3.1.4 Branch Functions (Lamp and Switches)




This is the program that I wrote for the second part of Activity 3.1.4. Here's a brief explanation of how it works. At first, it requires input from the first switch. If not pressed (0) it goes back to the beginning and once again waits for input from the switch. If pressed (1) it will go on to activate the lamp (M1). Upon activation of the lamp, it waits for input from I2. If not pressed (0) it stays on and goes back to wait for input from the I2 switch. If pressed, the light goes off and the program ends.




And this is what the whole setup looks like:

No comments:

Post a Comment