Arduino Reference
Mr. O'Connor

Arduino Basics

Language Basics

Program Structure
Data Types
Basic Mathematical Operations
The 'if' Structure (Branching/Decisions)
Conditional Loops - 'while' and 'do..while'
Counted Loops - 'for'

Serial Input and Output

Serial Output
Advanced Serial Communication (pdf)
Printing Base 10,16,8,2 Table (ino)
Basic Serial Input

Digital Output

Digital Output

Digital Input

Digital Input with Buttons
Button Input Code (ino)
Software Debouncing with the Bounce Library
Bounce2 Debounce Library Homepage

Analog Input

Analog Input
Print Voltage (ino)

Analog output (PWM)

Analog Output Using PWM

Timers and Hardware Interrupts

Hardware Interrupts
Timed Interrupts


DC Motors

Arduino to DC Motor Using NPN Transistor (png)
Using the SN754410 or L293 Motor Driver IC
Tutorial - DC Motor Control Using SN754410 H-Bridge IC
SN754410 / L293 Motor Driver Pin Diagram (jpg)
DFRobot Arduino Motor Shield Documentation (pdf)
DFRobot Arduino Motor Shield - Basic Movement Code (ino)
DFRobot Arduino Motor Shield V2
DFRobot Arduino Motor Shield V2 Sample Code (ino)

Servo Motors

How To Use A Servo Motor

Stepper Motors

What is a Stepper Motor?
Types of Stepper Motor
Stepper Voltage, Current, and Driver Info
Types of Driver Circuit
Stepper Motors using IC's
Arduino to Unipolar Stepper using Darlington Array (png)
Arduino to Unipolar Stepper Motor using Darlington Array - ARDUINO CODE (ino)
Wiring a unipolar motor as bipolar using an H-Bridge
Motor Specs
Minebea PM20S-020 Unipolar Stepper Info (pdf)
Howard Ind. P/N 1-19-4202 (pdf)



Using a Photoresistor as a Sensor
Pololu Light Sensor Library (zip) - unzip the QTRSensors folder to your library folder
Sample Code for 2 Digital Light sensors (ino)
Sample Code for a Single Light Sensor (ino)
Sample code for manually reading digital light sensor (ino)
Better sample code for manual reading of the light sensor (ino)

Adafruit TCS34725 Color Sensor

Product page with tutorial
Adafruit_TCS34725 Library download page (or install from library manager)
SoftwareWire Library download page (or install from library manager)
Adafruit_TCS34725softic2 Library download page
Mulitple Color Sensor Program using SoftwareWire Library (ino)


LM35 Temperature Sensor


PING Ultrasonic Demo Program (ino)


ADXL335 Accelerometer Breakout Information
Simple ADXL335 Read Program (ino)

Input Devices

Using the 12 Key Keypad
PS2 Style Joystick

Output Devices

Adafruit RGB LCD Product Use Page