Getting Started with an Arduino

Different Arduinos will have different physical configurations, but all will have a USB connector of some sort. This connector serves two purposes.

  1. When plugged into a computer, it allows you to upload a program to the Arduino (it also provides power for testing)
  2. When plugged into a USB power supply, it provides power for the Arduino to run its program

When you have your Arduino plugged into your computer, it may seem like it is just acting as an interface between your computer and the devices attached to it. This is NOT the case. The Arduino is a standalone computer. Once it is programmed, any time it is provided with power it will complete whatever its programmed activity is. Once you have your Arduino programmed, you are welcome to come up to the front and plug it in to one of my USB power supplies and demonstrate to yourself that it doesn't need a computer.

The Arduino IDE

There is a free Integrated Development Environment (IDE) for the Arduino platform. Most of the Arduinos we will be using in lab are a special inexpensive ($10) version made by AdaFruit, called a "Pro Trinket". There is a special version of the IDE for this Arduino. We will also be working with NeoPixels, so you should have the NeoPixel library installed as well. If you didn't do either of these things before class, here are the links:

Once you have it installed, launch the IDE. You should see something like this:

This is the window where you will write your Arduino programs, called "Sketches". Before you do anything else, on the Tools menu, find Board and (unless told otherwise) select Pro Trinket 5V (USB). This will tell the IDE what specific type of Arduino it should compile code for.

The Arduino, unfortunately, is not programmed in Python. Instead, it is programmed in a simple variant of the C programming language. Don't worry, the sorts of programs we will be dealing with here are quite simple, and all you should have to learn are a few simple syntax changes: