Getting started with arduino
Since I've been playing around with the Arduino a bit recently (thank you Rob!) I thought I'd write a quick post on how you can get started with the arudino and it's many variants.
If you're into creating electronics and creating circuits, then the arduino is for you. The arduino is a small electronic board that you might find some variant thereof in your thermostat at home, or Rob's thing-o-matic for example. You'll probably find something akin to an arduino in most embedded systems.
To get started, you'll need to buy an Arduino Uno (you can probably find it cheaper elsewhere). Some LEDs, resistors, and jumper cables wouldn't hurt either.
Once you've got all that, you can start to have some fun. To compile and send programs to your new arudino, you'll need to download and install the Arduino IDE from the official arduino website (direct link for debian / ubuntu users). Once installed, connect your arduino to your computer using the supplied cable and open the IDE.
Next, we need to set the IDE up to send correctly compiled programs to our new board. Firstly, we need to tell the IDE what kind of board we have. Go to Tools->Board and select Arduino Uno. We also need to tell the IDE which programmer to use. Go to Tools->Programmer and select AVRISP mkII. Finally, we need to tell the IDE which serial port the arduino is connected on. Go to Tools->Serial Port and select the last item in the list. If the next steps don't work, try selecting a different option in this list until it works.
With that out of the way, we can start to test out our arduino! Arduinos are programmed using a variant of C, which is similar to GSGL. To get started quickly, let's send some example code to our arduino to start with. In the file menu, go to Examples->01. Basics and select Blink.
A new window will pop up containing the example code. To compile and send the code to your arduino, click the second button in from the left, with the right facing arrow on it. This will send the code to your arduino. Once it's done, you should see a flashing light on your arduino board!
The other buttons are also useful. Here's an explanation:
- Verify - Compiles and checks your code for syntax errors, but doesn't write it to the arduino.
- Upload - Compiles your code and sends it to your arduino.
- New - Creates a new document. This clears your existing tab! Use the down arrow below the 6 in the picture and select New Tab instead.
- Open - Opens an existing document. Again, this clears your existing tab.
- Save - This should be obvious.
- Opens the serial monitor. The serial monitor is like a very basic console which allows you to see what your arduino is saying and lets you send messages to it.
That just about covers my very basic getting started tutorial for the arduino. If you've got any questions or comments, please leave them down below.
Sources and Further Reading
- The official Arduino website
- Basic arduino tutorials - Learn more about the arduino board and what everything does.
- Arduino language reference - Useful when writing code.
- 08249 Labs - A comprehensive set of tutorials that teach everything that you'll need to get started (Hull University students only).
- Simple Arduino Serial Communication by Arduino Basics
- Arduino Programming Cheat Sheet by Mark Liffiton