Multiple Buttons and LEDs

Yesterday's post showed the making of this little two button remote control so it seems only right to to include it in this post about reading multiple buttons. It's just two simple buttons that pull the data line down to ground when pressed and could easily be recreated on the breadboard if required. We're also going to talk about multiple LED's and set up the framework for using multiples even though the we're only going to using the one built in LED again. The main difference between this program and the previous one is that the inputs and outputs are going to be defined as arrays of values instead of just single values. Right at the top of the program it's important to define how many inputs and LED's there around going to be and then create an array of values to declare which data lines these things are going to be on, in this instance D1 and D2 and the same LED as before. even though there is only one LED we can still define it in an array. Now when...