I am trying to upload a code for a useless box into my Arduino Uno....help!

What errors? People don't just know what your problem is. When you hit that upload button, the various bits of the system spit out error messages. You are supposed to read them and attempt to understand them, not just throw your hands in the air and be like "She no work!". Maybe this sketch of yours is completely bogus. Maybe it uses libraries you haven't installed. Maybe it's fine, but you are pasting the whole web page with line numbers into your IDE (use"raw" on github. better still - learn to use git). Maybe you haven't selected the serial port and board type. Maybe you haven't plugged your arduino in, and expect the bytes to get transferred over by magic.

Please read the sticky posts on this forum. For a start, no-one is going to navigate over to that site and bother to read the code.

Well - except me. …

Yikes. I'd prefer a data-driven approach, but that's just me. At least the code is simple. Do you understand that you need to build a box pretty much exactly the same as the box that this code is meant to run on?

Anyway - there's no reason I can see why this wouldn't compile. In fact ... I just changed this sketch so that the button was INPUT_PULLUP and the if() condition was LOW rather than HIGH (because I don't have a suitably positioned toggle switch), connected a little X-Y servo setup that I have to pins 9 and 10, and the sketch seems to work beautifully. no problems there. When I touch pin2 to ground, the x/y setup does a sequence of amusing little moves.

  • plug your arduino into your computer with a USB cable

  • Select the correct board from the Tools>Board menu

  • Select the port Tools>Port menu

  • If you don't see one that says (Arduino/Genuino) or something like that, try plugging into a different USB port

  • hit the upload button

If is still won't upload, come back here and copy-paste the output from the errors widow into your message so we can baybe have a bash at what's going on. Better still - take it to "Installation and Troubleshooting".