Learn the basics of Arduino through this collection tutorials. All code examples are available directly in all IDEs.
Read a potentiometer, print its state out to the Arduino Serial Monitor.
The bare minimum of code needed to start an Arduino sketch.
Turn an LED on and off every second.
Read a switch, print the state out to the Arduino Serial Monitor.
Demonstrates the use of analog output to fade an LED.
Reads an analog input and prints the voltage to the Serial Monitor.
Blink an LED without using the delay() function.
Learn how to wire and program a pushbutton to control an LED.
Read a pushbutton, filtering noise.
Demonstrates the use of INPUT_PULLUP with pinMode()
Count the number of button pushes.
A three-key musical keyboard using force sensors and a piezo speaker.
Play a melody with a Piezo speaker.
Play tones on multiple speakers sequentially using the tone() command.
Play a pitch on a piezo speaker depending on an analog input.
Read an analog input pin, map the result, and then use that data to dim or brighten an LED.
Use a potentiometer to control the blinking of an LED.
Fade 12 LEDs on and off, one by one, using an Arduino Mega board.
Define a maximum and minimum for expected analog sensor values.
Use an analog output (PWM pin) to fade an LED.
Smooth multiple readings of an analog input.
Demonstrates advanced Arduino serial output functions.
Move the mouse to change the brightness of an LED.
Send data to the computer and graph it in Processing.
Send MIDI note messages serially.
Use two of the serial ports available on the Arduino Mega.
Turn a LED on and off by sending data to your Arduino from Processing or Max/MSP.
Parse a comma-separated string of integers to fade an LED.
Send multiple variables using a call-and-response (handshaking) method.
Send multiple variables using a call-and-response (handshaking) method, and ASCII-encode the values before sending.
Demonstrates the use of serialEvent() function.
Demonstrates how to virtually connect Serial and Serial1.
This example demonstrates how to send multiple values from the Arduino board to the computer.
A variation on the For Loop example that demonstrates how to use an array.
Control multiple LEDs with a for loop and.
How to choose between a discrete number of values.
A second switch-case example, showing how to take different actions based on the characters received in the serial port.
How to use a while loop to calibrate a sensor while a button is being read.
Use an if statement to change the output conditions based on changing the input conditions.
Read an ADXL3xx accelerometer.
This tutorial shows you how to use a Piezo element to detect vibration.
Learn how to read data from the Memsic 2125 Two-axis accelerometer.
Detect objects with an ultrasonic range finder.
Use the operators to recognise the type of character we are dealing with.
Add strings together in a variety of ways.
Use the += operator and the concat() method to append things to Strings.
Change the case of a string.
Get/set the value of a specific character in a string.
Learn how to make alphabetic comparisons between Strings. They are useful for sorting and alphabetizing, among other things.
Initialize string objects.
Look for the first/last instance of a character in a string.
This example shows you how to use this command to reply to an input from the Serial Monitor.
Get and trim the length of a string.
The replace() function allows you to replace all instances of a given character in a string with another character.
Check which characters/substrings a given string starts or ends with.
Look for "phrases" within a given string.
Allows you to convert a String to an integer number.
Control cursor movement with 5 pushbuttons.
Controls a computer cursor movement with a Joystick when a button is pressed.
Demonstrates the Mouse and Keyboard commands in one program.
Logs out the current user with key commands.
Sends a text string when a button is pressed.
Opens a new window in the Arduino IDE and reprograms the Leonardo with a simple blink program.
Reads a byte from the serial port, and sends back a keystroke.