Half Inputs

By Eunchae Kim

This Half Inputs assignment required an Arduino program that contained the btn and swt variables. Using these variables, and the new Boolean type, the code should turn on a different colored LED for each possible combination of btn and swt. Only one color of LEDs is on at a time.

I chose to use logical operators for this assignment as I thought it was more useful to see everything laid out. It was my first time utilizing this type, and I wanted to fully understand what the code was doing (at each step of the process). Additionally, I think that because btn and swt isn’t too long, and the operation of the code was relatively simple, I found it okay to use the logical operators method for this particular assignment. For later projects when the variables and code get more complex, I will definitely start incorporating nested conditionals.

TIP FOR PAST SELF: Using the the understanding of the code, I would tell my past self to really try and write it independently instead of relying on the worksheet in class. And experiment! There are several different ways to write this code, so explore the different avenues before deciding on a set path.