Getting Started
Last updated
Last updated
Download the Arduino IDE
At a minimum, each piece of Arduino code (called a sketch) must have a setup()
function and a loop()
function.
Any line that started withs two slashes (//) is a comment and will not be read by the compiler
Getting an LED to blink is pretty much the simplest thing you can do with an Arduino to see physical output.
Components
LED
220 Ohm to 1k Ohm Resistor
Breadboard
2 x Male-male jumper wire
To build the circuit, connect one end of the resistor to Arduino pin 13.
Connect the long leg of the LED (the positive leg, called the anode) to the other end of the resistor. Connect the short leg of the LED (the negative leg, called the cathode) to the Arduino GND, as shown in the diagram and the schematic below.
Most Arduino boards already have an LED attached to pin 13 on the board itself. If you run this example with no hardware attached, you should see that LED blink.
Connect the circuit using a breadboard
Open up the IDE and past in the above code
Plug in the Arduino to your computer via a usb cable. We need to tell the IDE to use the usb port. Select the plugged in Arduino from Tools > Port. You should only need to do this once.
Click upload in the IDE to copy the code over to the Arduino
Press the Reset button on the Arduino to run the code.