Coding Assignment 4:True or False
- Gabrielle Grenier
- Feb 19, 2019
- 1 min read
This week we added a third external button to our micro bit. In class when we added the button we also began using booleans which allow us to make one bit of code true or false when another bit of code is working. Our example code allowed us to push our external button to either a "t" or "f", which gave me the idea to actually make a true or false type game. I first would like to say that my external buttons hate me and had their own mood swings so they didn't always work even when wired correctly.That being said i wired the external button as well as a green LED and a red LED. I coded a correct math statement (5+2+=7) and an incorrect statement (9+4=10) in the place of "t" and "f". I originally attempted phrases but they took too long to scroll across the screen. I coded button A to light the green LED and show a check mark and button B to light the red LED and show an X. the point is to choose whether the statement given is true or false. I came across a problem with my external button as it was always set to 0 and would not change when i pushed it. I checked the wiring and the code and it all seemed sound so my next step was beginning to change some pins around however i did not get to finish. I have a feeling it was just an issue with the button but id have to do more investigating.


Comments