Monday, November 23, 2015

The Button Challenge

For this post, our challenge is pretty similar to Project 10. Like the one before, we had to light up an LED light using the code given to us. The only difference is that it'll have the ability to both turn on and turn off the light. If the light is off, it'd turn on and if the light was off, it'd turn on an LED light. For this post we had to have a variable. To begin we set it at 0. After pushing the button, if the variable was 0, we'd turn on the light and set the variable to 1. If the button is pushed and has the variable off 1, to turn it off, push the button and set the variable back to 0.

No comments:

Post a Comment