Step 0:
Be Calm! This may be totally new to you or maybe not but nothing will blow up and nobody will get hurt. Your Arduino could give it's life in service of your learning (probably not) but that's the worst that will happen.
Note: All of these Arduino IDE startup steps are done with the Arduino connected to the computer with the USB cable.
I don't remember what window it opens the very first time you use the IDE. After that it opens whatever sketch (program) you were last working on. If you close the window the IDE thinks you don't want to play and shuts down the software. Whatever the window is the code in that window is known as a sketch (a program really). The first thing we are going to do is get a particular sketch to work with (even if it turn out to be the same as the default).
Step 1:
Go to the drop down File menu and choose File > Examples > Basics > Blink. Then close whatever the original window was. Here is what you will see as you select the Blink sketch...
At this point you will have two windows open in the IDE. Close the original one, whatever it was, and leave only the Blink window open.
Step 2:
When you start up the Arduino IDE (Integrated Developer Environment) you will get a tool bar that looks something like this..
The window showing the Blink Sketch will look like this....
Step 3:
The next thing we need to do is check that the IDE software knows (recognizes) the Arduino that you have connected to your computer's USB port. To do this we go to the Tools menu and look near the bottom where it shows Board: , Port: , and Board Info. The IDE may have automatically recognized your Arduino or perhaps not. We will check that in a minute.
If the 'Board:' is not set to Arduino Uno select the Board: drop down menu and choose Arduino Uno from the list (there will be many many choices). If you got a different model of Arduino or Arduino clone then you can make the appropriate selection.
The port setting is often inscrutable. Select the port menu and consider your options (mine are below)
On a PC the ports are usually labelled COMM1 or some other number. On Mac's they often have usbserial in the name. Choose one of the USB ports (NOT the Bluetooth port) and then we'll test it.
If you don't see a port: If you don't see a port listed it might be that you need to install a driver for communicating with your Arduino clone. Instructions for installing the driver should be in the kit you purchased or sometimes on a mini CD. You can also go to the manufacturers website and search for the driver there. It is possible that you need to install a CH340 driver for your Arduino which is common for Arduino clones manufactured in China. Instructions are here if you eventually decide this is what you need to do.
Step 4:
Testing the 'Port:' setting. At the top left of your sketch window there are 5 'buttons. A check mark, a right arrow, and 3 buttons that have to do with saving and opening sketchs. The check is a tool for checking to see if the code we have written is properly written (it can still do something we don't want!). This is sort of like spell checkers making sure we spelled the word right but not making sure what we've written makes sense. The 'right arrow' is the upload button which is the one we need right now. When we select this button the IDE checks our code (same process as the check mark) and then tries to send the code to the kind of board we chose in Board: on the port we chose on Port: Here is where the button is....
...and this is what your sketch window will look like if things go WRONG! Always best to show what goes wrong first. Look further down to see what it will look like if the port works. The error message that you see tells you the IDE tried to send the sketch where you told it to (the port) and there was nothing there to receive it. If you get this error message go back and change the port setting to a different port. One of the ports should work if your Arduino is attached to a USB port on your computer.
When your upload works your sketch window should look something like this....notice where it says "Done uploading." in the middle of the sketch window.
Once the Blink sketch has been successfully uploaded you should see another LED blinking slowly (usually near the power cord). We will explore coding in the Blinky lab next week.
Step 5:
Once you get the port working there are a couple of other things I want you to notice before we go on. This whole system is not particularly clever and if you tell the IDE to upload the sketch again it will just do that (it won't cheekily point out to you that you just did this!) Upload the sketch again but this time watch the area on your Arduino near the power connector. You should notice 2 LEDs flashing there for a few moments. These LED's indicate the back and forth communication between the IDE and the Arduino. If you look closely the LEDs are labelled TX and RX on the board which represent a communication protocol. You should expect to see those LEDs flash every time you upload a sketch. It will look a little like this.
Leave the Arduino connected to your computer and the IDE up and running. There will be one more task on the lab page.
Done!