so I am trying to do the most basic of basic, but I already might of broke one board (the people helping me seem to think the board is probably still good but I can't get it to upload) So new board, new attempt, I don't want to screw this up a second time.
My plan is to connect the 5.v from the board to the power rail of a breadboard and then each button connecting to that rail with one wire and the other wire from each button going to a different digital pin. The ground of the power rail will be connected to one of the power grounds (does it matter which?) for the optical stick which requires a 5v power source and it's own ground. Because the optical stick goes off (rather than on) when a direction is selected, I have a nand gate switching it so instead the direction inputted will turn on. This is going on the breadboard too and will require a spot on the powerrail, and on the ground rail and then the outputs from the gate will go directly to the remaining digital pins on the uno board.
My questions are, first is the above plan viable and reasonable?
Is there already code written that more or less does what I am trying to accomplish (with minor adjustments to the specific pin referenced in the sketch) ?