sparkfun Inventor's Kit User manual

Chipsmall Limited consists of a professional team with an average of over 10 year of expertise in the distribution
of electronic components. Based in Hongkong, we have already established firm and mutual-benefit business
relationships with customers from,Europe,America and south Asia,supplying obsolete and hard-to-find components
to meet their specific needs.
With the principle of “Quality Parts,Customers Priority,Honest Operation,and Considerate Service”,our business
mainly focus on the distribution of electronic components. Line cards we deal with include
Microchip,ALPS,ROHM,Xilinx,Pulse,ON,Everlight and Freescale. Main products comprise
IC,Modules,Potentiometer,IC Socket,Relay,Connector.Our parts cover such applications as commercial,industrial,
and automotives areas.
We are looking forward to setting up business relationship with you and hope to provide you with the best service
and solution. Let us make a better world for our industry!
Contact us
Tel: +86-755-8981 8866 Fax: +86-755-8427 6832
Email & Skype: [email protected]om Web: www.chipsmall.com
Address: A1208, Overseas Decoration Building, #122 Zhenhua RD., Futian, Shenzhen, China

SparkFun
Inventor’s Kit
VERSION 4.0a
Your Guide to the SIK
for the SparkFun RedBoard

SparkFun Inventor’s Kit, Version 4.0
WELCOME TO THE
SPARKFUN INVENTOR’S
KIT (SIK) GUIDE.
This is your map for navigating beginning embedded electronics.
This booklet contains all the information you will need to build five
projects encompassing the 16 circuits of the SIK for the SparkFun
RedBoard. At the center of this manual is one core philosophy: that
anyone can (and should) play around with electronics. When you’re
done with this guide, you will have built five great projects and
acquired the know-how to create countless more. Now enough talk
— let’s start something!
For a digital version of this guide with more in-depth information for
each circuit and links explaining relevant terms and concepts, visit:
sparkfun.com/SIKguide

Contents
INTRODUCTION 2
2 The RedBoard Platform
3 Baseplate Assembly
4 RedBoard Anatomy
5 Breadboard Anatomy
6 The Arduino IDE
10 Inventory of Parts
PROJECT 1: LIGHT 12
13 Circuit 1A: Blinking an LED
20 Circuit 1B: Potentiometer
26 Circuit 1C: Photoresistor
31 Circuit 1D: RGB Night-Light
PROJECT 2: SOUND 36
37 Circuit 2A: Buzzer
42 Circuit 2B: Digital Trumpet
47 Circuit 2C: “Simon Says” Game
PROJECT 3: MOTION 53
54 Circuit 3A: Servo Motors
60 Circuit 3B: Distance Sensor
65 Circuit 3C: Motion Alarm
PROJECT 4: DISPLAY 71
72 Circuit 4A: LCD “Hello, World!”
77 Circuit 4B: Temperature Sensor
82 Circuit 4C: “DIY Who Am I?” Game
PROJECT 5: ROBOT 88
89 Circuit 5A: Motor Basics
96 Circuit 5B: Remote-Controlled Robot
102 Circuit 5C: Autonomous Robot
GOING FURTHER 106
1 : INTRO

IOREF
RESET
RESET
7-15V
SCL
SDA
AREF
GND
13
12
~11
~10
~9
8
7
~6
~5
4
~3
2
1
0
TX
RX
13
3.3V
5V
GND
GND
VIN
A0
A1
A2
A3
A4
A5
POWER ANALOG IN
DIGITAL (PWM~)
ON
ISP
TX
RX
START SOMETHING
2 : INTRO
A COMPUTER FOR THE
PHYSICAL WORLD
The SparkFun RedBoard is your
development platform. At its roots, the
RedBoard is essentially a small, portable
computer, also known as a microcontroller.
It is capable of taking inputs (such as the
push of a button or a reading from a light
sensor) and interpreting that information
to control various outputs (like blinking an
LED light or spinning an electric motor).
That’s where the term “physical computing”
comes in; this board is capable of taking the
world of electronics and relating it to the
physical world in a real and tangible way.
THE SPARKFUN REDBOARD is one of a multitude of development boards based on
the ATmega328 microprocessor. It has 14 digital input/output pins (six of which can be
PWM outputs), six analog inputs, a 16MHz crystal oscillator, a USB connection, a power
jack, and a reset button. You’ll learn more about each of the RedBoard's features as you
progress through this guide.
The RedBoard Platform
THE DIY REVOLUTION: At SparkFun we believe that an understanding of electronics
is a core literacy that opens up a world of opportunities in the fields of robotics, Internet
of Things (IoT), engineering, fashion, medical industries, environmental sciences,
performing arts and more. This guide is designed to explore the connection between
software and hardware, introducing Arduino code and SparkFun parts as they are
used in the context of building engaging projects. The circuits in this guide progress
in difficulty as new concepts and components are introduced. Completing each circuit
means much more than just “experimenting”; you will walk away with a fun project you
can use — and a sense of accomplishment that is just the beginning of your electronics
journey. At the end of each circuit, you'll find coding challenges that extend your learning
and fuel ongoing innovation.

Baseplate Assembly
Before you can build circuits, you’ll want to first assemble the breadboard baseplate. This
apparatus makes circuit building easier by keeping the RedBoard microcontroller and the
breadboard connected without the worry of disconnecting or damaging your circuit.
TO BEGIN, collect your parts: the RedBoard,
breadboard, included screwdriver, baseplate and
two baseplate screws.
Your screwdriver has both Phillips and
flatheads. If it is not already in position,
pull the shaft out and switch to the
Phillips head.
3 : INTRO
PEEL the adhesive backing off the breadboard.
CAREFULLY ALIGN the breadboard over its spot on the baseplate. The text on the
breadboard should face the same direction as the text on the baseplate. Firmly press the
breadboard to the baseplate to adhere it.
ALIGN THE REDBOARD with its spot
on the baseplate. The text on it should
face the same direction as the text on
the breadboard and the baseplate. Using
one of the two included screws, affix the
RedBoard to one of the four stand-off holes
found on the baseplate. The plastic holes
are not threaded, so you will need to apply
pressure as you twist the screwdriver.
Screw the second screw in the stand-off
hole diagonally across from the first. With
that, your baseplate is now assembled.

4 : INTRO
IOREF
RESET
RESET
7-15V
SCL
SDA
AREF
GND
13
12
~11
~10
~9
8
7
~6
~5
4
~3
2
1
0
TX
RX
13
3.3V
5V
GND
GND
VIN
A0
A1
A2
A3
A4
A5
POWER ANALOG IN
DIGITAL (PWM~)
ON
ISP
TX
RX
START SOMETHING
Anatomy of the SparkFun RedBoard
REDBOARD HARDWARE OVERVIEW
APOWER IN
(BARREL JACK) Can be used with either a 9V or 12V “wall-wart” or a battery pack.
BPOWER IN
(USB PORT)
Provides power and communicates with your board
when plugged into your computer via USB.
CLED
(RX: RECEIVING) Shows when the FTDI chip is receiving data bits from the computer.
DLED
(TX: TRANSMITTING) Shows when the FTDI chip is transmitting data bits to the computer.
EONBOARD LED
PIN D
This LED, connected to digital pin 13, can be controlled
in your program and is great for troubleshooting.
F
PINS AREF,
GROUND, DIGITAL,
RX, TX, SDA, SCL
These pins can be used for inputs, outputs, power and ground.
GPOWER LED Illuminated when the board is connected to a power source.
HRESET BUTTON A manual reset switch that will restart the RedBoard and your code.
IISP HEADER This is the In-System Programming header. It is used to program the ATMega328
directly. It will not be used in this guide.
J
ANALOG IN,
VOLTAGE IN,
GROUND, . AND
V OUT, RESET
The power bus has pins to power your circuits with various voltages. The analog
inputs allow you to read analog signals.
KRFU This stands for Reserved for Future Use.
A
B
C
D
E
F
H
I
J
G
K

5 : INTRO
Anatomy of the Breadboard
A breadboard is a circuit-building platform that allows you to
connect multiple components without using a soldering iron.
CENTERLINE
This line divides
the breadboard
in half, restricting
electricity to one
half or the other.
POWER BUS
Each side of the breadboard has a pair of
vertical connections marked –and +
+POWER: Each + sign runs power
anywhere in the vertical column.
– GROUND: Each – sign runs to ground
anywhere in the vertical column.
HORIZONTAL ROWS
Each series of 5 sockets marked
a–e and f–j are connected.
Components connected to a row
will be connected to any other
part inserted in the same row.
MAKING A
CONNECTION
Most of the
components in this
kit are breadboard-
friendly and can be
easily installed and
removed.

6 : INTRO
The Arduino IDE
IN ORDER TO GET YOUR
REDBOARD UP AND RUNNING,
you'll need to download the newest
version of the Arduino software
from www.arduino.cc (it's free!).
This software, known as the Arduino
IDE (Integrated Development
Environment), will allow you to program the RedBoard to do exactly what you want.
It’s like a word processor for coding. With an internet-capable computer, open up your
favorite browser and type the following URL into the address bar:
DOWNLOAD THE SOFTWARE HERE: arduino.cc/downloads
1. DOWNLOAD AND INSTALL ARDUINO IDE
Select the installer option appropriate for the operating system you are using. Once
finished downloading, open the file and follow the instructions to install.
2. INSTALL USB DRIVERS
In order for the RedBoard hardware to work with your computer’s operating system,
you will need to install a few drivers. Please go to www.sparkfun.com/FTDI for specific
instructions on how to install the USB drivers onto your computer.
3. CONNECT THE REDBOARD TO A COMPUTER
Use the USB cable provided in the SIK to connect the RedBoard to one of your computer’s
USB inputs.

7 : INTRO
sparkfun.com/SIKcode
MAC OS: Find “Arduino” in your
“Applications” folder in Finder.
Right-click (ctrl + click) on “Arduino”
and select “Show Package Contents.”
Arduino Open
Show Package Contents
Move to Trash
WINDOWS: Copy or move the unzipped “SIK Guide Code” files from “Downloads” to the
Arduino application’s “Examples” folder.
LINUX: Distribution-specific setup instructions for Linux can be found at:
Copy or move the unzipped “SIK Guide Code” folder from your
“Downloads” folder into the Arduino application’s folder named “Examples.”
PROGRAM
FILES
LOCAL
DISK (C:)
ARDUINO EXAMPLES
CONTENTSARDUINO JAVA EXAMPLES
4. DOWNLOAD AND INSTALL THE SIK CODE
Each of the circuits you will build in the SparkFun Inventor’s Kit has an Arduino
code sketch already written for it. This guide will show you how to manipulate that
code to control your hardware.
DOWNLOAD THE CODE HERE:
COPY “SIK GUIDE CODE” INTO “EXAMPLES”
LIBRARY IN ARDUINO FOLDER
Your browser will download the code automatically or ask you if you would like to
download the .zip file. Select “Save File.” Locate the code (usually in your browser’s
“Downloads” folder). You'll need to relocate it to the “Examples” subfolder in your
Arduino IDE installation in order for it to function properly.
Unzip the file “SIK GUIDE CODE.” It should be located in your browser’s “Downloads”
folder. Right-click (or ctrl + click) the zipped folder and choose “unzip.”
http://arduino.cc/playground/learning/linux

Blink
Blink | Arduino 1.8.5
Arduino/Genuino Uno on/dev/cu.usbserialDNO18JWS
8 : INTRO
GRAPHICAL USER INTERFACE (GUI)
AVERIFY Compiles and approves your code. It will catch errors in syntax
(like missing semicolons or parentheses).
BUPLOAD Sends your code to the RedBoard. When you click it, you
should see the lights on your board blink rapidly.
CS A V E Saves the currently active sketch.
DOPEN Opens an existing sketch.
ENEW Opens up a new code window tab.
FDEBUG WINDOW Displays any errors generated by your sketch.
GSKETCH NAME Displays the name of the sketch you are currently working on.
HCODE AREA Where you compose or edit the code for your sketch.
IMESSAGE AREA Indicates if the code is compiling, uploading or has errors.
JCONNECTION AREA Displays the board and serial port currently selected.
KSERIAL MONITOR Opens a window that displays any serial information
your RedBoard is transmitting (useful for debugging).
A
BDC
EG
H
I
K
F
J
THE THREE MOST
IMPORTANT
COMMANDS IN
THE ARDUINO IDE
5. OPEN THE ARDUINO IDE:
Open the Arduino IDE software on your computer. Poke around and get to know the
interface. We aren’t going to code right away; this step is to set your IDE to identify
your RedBoard.

9 : INTRO
dit Sketch Tools Help
Auto Format
Archive Sketch
Fix Encoding and Reload
Serial Monitor
Serial Plotter
Board: “Arduino/Genuino Uno”
Port
Get Board Info
Programmer: “AVRISPmkII”
Burn Bootlader
Serial Ports
/dev/cu.usbserialDNO18JWS
dit Sketch Tools Help
Auto Format
Archive Sketch
Fix Encoding and Reload
Serial Monitor
Serial Plotter
Board: “Arduino/Genuino Uno”
Port
Get Board Info
Programmer: “AVRISPmkII”
Burn Bootlader
Serial Ports
COM1
COM2
COM51(Arduino/Genuino UNO)
6. SELECT YOUR BOARD AND SERIAL DEVICE
NOTE: Your SparkFun RedBoard and the Arduino/Genuino UNO are
interchangeable, but you won’t find the RedBoard listed in the Arduino
software. Select “ARDUINO/GENUINO UNO” instead.
dit Sketch Tools Help
Auto Format
Archive Sketch
Fix Encoding and Reload
Serial Monitor
Serial Plotter
Board: “Arduino/Genuino Uno”
Port
Get Board Info
Boards Manager…
TeensyDuino
Teensy 3.6
Teensy 3.5
Teensy 3.2/3.1
Teensy 3.0
Teensy LC
Teensy++ 2.0
Teensy 2.0
Arduino AVR Boards
Arduino/Genuino Uno
Arduino Duemilanove or Diecimila
Arduino Nano
SELECT YOUR BOARD
Tools > Board > Arduino/Genuino UNO
SELECT YOUR PORT (WINDOWS)
Tools > Port > COM#(Arduino/Genuino UNO)
SELECT YOUR PORT (MAC OS)
Tools > Port > /dev/cu.usbserialXXXXXXXX
SELECT YOUR PORT (LINUX)
Distribution-specific serial device setup instructions can be found HERE:
http://arduino.cc/playground/learning/linux

+ –
+ –
+ –
+ –
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
abcde fghij
abcde fghij
+ - + -
+ - + -
TMP
IOREF
RESET
RESET
7-15V
SCL
SDA
AREF
GND
13
12
~11
~10
~9
8
7
~6
~5
4
~3
2
1
0
TX
RX
13
3.3V
5V
GND
GND
VIN
A0
A1
A2
A3
A4
A5
POWER ANALOG IN
DIGITAL (PWM~)
ON
ISP
TX
RX
START SOMETHING
VM
VCC
GND
A01
A02
B02
B01
GND
PWMA
A12
A11
ST
BY
B11
B12
PWMB
GND
MOTOR
DRIVER
H8106
T
VCC
Trig
Echo
GND
TJP16527BH2
1652
R
10 : INTRO
Inventory of Parts
The SparkFun Inventor’s Kit contains an extensive array of electronic components. As
you work your way through each circuit, you will learn to use new and more complicated
parts to accomplish increasingly complex tasks.
MOTOR
DRIVER
JUMPER
WIRES
SERVO
MOTOR
ULTRASONIC
DISTANCE SENSOR
OK RESISTORS
RESISTORS
PHOTORESISTOR
PIEZO
BUZZER
SWITCH
POTENTIOMETER
GEARMOTORS
SPARKFUN REDBOARD BREADBOARD
LEDS
TEMPERATURE
SENSOR
PUSH
BUTTONS
LCD DISPLAY

11 : INTRO
Let’s Get
Started
With Your
First Circuit!

13 : CIRCUIT 1A
PROJECT 1
Welcome to your rst SparkFun Inventor’s Kit
project. Each project is broken up into several
circuits, the last circuit being a culmination of
the technologies that came before. ere are ve
projects total, each designed to help you learn about
new technologies and concepts. is rst project
will set the foundation for the rest and will aid in
helping you understand the fundamentals of circuit
building and electricity!
In Project 1, you will learn about Light-
Emitting Diodes (LEDs), resistors,
inputs, outputs and sensors. e rst
project will be to build and program your own
multicolored night-light! e night-light uses a
sensor to turn on an RGB (Red, Green, Blue) LED
when it gets dark, and you will be able to change the
color using an input knob.
NEW COMPONENTS INTRODUCED
IN THIS PROJECT
• LEDS
• RESISTORS
• POTENTIOMETERS
• PHOTORESISTORS
NEW CONCEPTS INTRODUCED IN THIS PROJECT
• POLARITY
• OHM'S LAW
• DIGITAL OUTPUT
• ANALOG VS. DIGITAL
• ANALOG INPUT
• ANALOG TO DIGITAL CONVERSION
• VOLTAGE DIVIDER
• PULSE-WIDTH MODULATION
• FUNCTIONS
YOU WILL LEARN
• HOW TO UPLOAD A PROGRAM TO
YOUR REDBOARD
• CIRCUIT-BUILDING BASICS
• HOW TO CONTROL LEDS WITH
DIGITAL OUTPUTS
• HOW TO READ SENSORS
WITH ANALOG INPUTS
BLINKING
AN LED
READING A
POTENTIOMETER
READING A
PHOTORESISTOR
RGB NIGHT-LIGHT
NEW IDEAS
Each project will introduce new
concepts and components, which will
be described in more detail as you
progress through the circuits.
AB C D

14 : CIRCUIT 1A
YOU
NEED
NEW COMPONENTS
LIGHT-EMITTING DIODES (LEDS)
are small lights made from a silicon diode.
They come in different colors, brightnesses
and sizes. LEDs (pronounced el-ee-dees)
have a positive (+) leg and a negative (-)
leg, and they will only let electricity flow
through them in one direction. LEDs can
also burn out if too much electricity flows
through them, so you should always use a
resistor to limit the current when you wire
an LED into a circuit.
RESISTORS resist the flow of electricity.
You can use them to protect sensitive
components like LEDs. The strength of a
resistor (measured in ohms) is marked on
the body of the resistor using small colored
bands. Each color stands for a number,
which you can look up using
a resistor chart. One can be
found at the back of this book.
NEW
CONCEPTS
POLARITY: Many electronics
components have polarity,
meanig electricity can (and
should) flow through them in
only one direction. Polarized
components, like an LED,
have a positive and a negative
leg and only work when electricity flows
through them in one direction. Some
components, like resistors, do not have
polarity; electricity can flow through them
in either direction.
OHM’S LAW describes the relationship between
the three fundamental elements of electricity:
voltage, resistance and current. is
relationship can be represented by this equation:
V=I•R
V= Voltage in volts
I = Current in amps
Circuit 1A:
Blinking an LED
You can find LEDs in just about any source
of light, from the bulbs lighting your home
to the tiny status lights flashing on your
home electronics. Blinking an LED is the
classic starting point for learning how to
program embedded electronics. It’s the
“Hello, World!” of microcontrollers. In this
circuit, you’ll write code that makes an LED
blink on and off.
+–
LED 330Ω RESISTOR 2 JUMPER WIRES

15 : CIRCUIT 1A
R = Resistance in ohms (Ω)
is equation is used to calculate what resistor values
are suitable to suciently limit the current owing to
the LED so that it does not get too hot and burn out.
DIGITAL OUTPUT: When working with
microcontrollers such as the RedBoard, there
are a variety of pins to which you can connect
electronic components. Knowing which pins
perform which functions is important when
building your circuit. In this circuit, we will be using what is known as a digital output.
There are 14 of these pins found on the RedBoard. A digital output only has two states:
ON or OFF. These two states can also be thought of as HIGH LOW, TRUE FALSE
POLARIZED
COMPONENTS
Pay close attention to the LED. e
negative side of the LED is the short leg,
marked with a at edge.
FLAT EDGE
SHORT LEG
–+
RESISTOR
LEADS
Components like resistors need to have
their legs bent into 90° angles in order to
correctly t in the breadboard sockets.
NEW IDEAS
ELECTRICAL SAFETY: Never work on your circuits while the board is connected to
a power source. The SparkFun RedBoard operates at 5 volts, which, while not enough to
injure you, is enough to damage the components in your circuit.
COMPONENT ORIENTATION & POLARITY: Instructions on how to orient each of
the new components will be given before each circuit diagram. Many components have
polarity and have only one correct orientation, while others are nonpolarized.
IOREF
RESET
RESET
7-15V
SCL
SDA
AREF
GND
13
12
~11
~10
~9
8
7
~6
~5
4
~3
2
1
0
TX
RX
13
3.3V
5V
GND
GND
VIN
A0
A1
A2
A3
A4
A5
POWER ANALOG IN
DIGITAL (PWM~)
ON
ISP
TX
RX
START SOMETHING

IOREF
RESET
RESET
7-15V
SCL
SDA
AREF
GND
13
12
~11
~10
~9
8
7
~6
~5
4
~3
2
1
0
TX
RX
13
3.3V
5V
GND
GND
VIN
A0
A1
A2
A3
A4
A5
POWER ANALOG IN
DIGITAL (PWM~)
ON
ISP
TX
RX
START SOMETHING
+ –
+ –
+ –
+ –
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
abcde fghij
abcde fghij
+ - + -
+ - + -
HOOKUP GUIDE
READY TO START HOOKING EVERYTHING UP? Check out the circuit diagram and
hookup table below to see how everything is connected.
16 : CIRCUIT 1A
CONNECTION TYPES
REDBOARD CONNECTION BREADBOARD CONNECTION
JUMPER WIRES D13 to J2 GND to E1
LED A1(-) to A2(+)
330Ω RESISTOR
(ORANGE, ORANGE,
BROWN)
E2 to F2
D13 to J2
In this table, a yellow
highlight indicates that a
component has polarity
and will only function if
properly oriented.
CIRCUIT DIAGRAMS: Each circuit contains a circuit diagram, which
acts as a visual aid designed to make it easier for you to see how your circuit
should be built. Each colored line represents a jumper wire connection in the
circuit. All wires should have two connection points, which you also see in the
hookup table below.
COLORS: Please note that while traditionally red is used for power and
black is used for ground, all wires, no matter their color, function the same.
HOOKUP TABLES: Many electronics beginners nd
it helpful to have a coordinate system when building their
circuits. For each circuit, you’ll nd a hookup table that
lists the coordinates of each component or wire and where
it connects to the RedBoard, the breadboard, or both. e
breadboard has a letter/number coordinate system, just
like the game Battleship.
…means one end of a
component connects
to digital pin 13 on
your RedBoard and
the other connects to
J2 on the breadboard
FLAT EDGE

17 : CIRCUIT 1A
duino
File Edit Sketch Tools Help
New
Open
Open Recent
Sketchbook
Examples
Close
Save
Save As
Page Setup
Print
01.Basics
02.Digital
03.Analog
04.Communication
05.Control
06.Sensors
07.Display
08.Strings
09.USB
10.Starter Kit
ArduinoISP
SIK_Guide-Code-v_4 SIK_Circuit_1A-Blink
SIK_Circuit_1A-Potentiometer
SIK_Circuit_1A-Photoresistor
SIK_Circuit_1A-RGBNightlight
SIK_Circuit_1A-Buzzer
SIK_Circuit_1A-DigitalTrumpet
SIK_Circuit_1A-SimonSays
WHAT YOU
SHOULD SEE
e LED will ash on for two seconds, then
o for two seconds. If it doesn’t, make sure
you have assembled the circuit correctly
and veried and uploaded the code to your
board. See the Troubleshooting section at the
end of this circuit if that doesn’t work. One
of the best ways to understand the code you
uploaded is to change something and see
how it aects the behavior of your circuit.
What happens when you change the number
in one or both of the delay(2000);
lines of code (try 100 or 5000)?
Open the Arduino IDE
Connect the RedBoard to a USB port on your computer.
Open the Sketch: File > Examples > SIK_Guide_Code-V_4 > CIRCUIT_1A-BLINK
Select UPLOAD to program the sketch on the RedBoard.

18 : CIRCUIT 1A
ONBOARD LED PIN 13:
You may have noticed a second,
smaller LED blinking in unison
with the LED in your breadboard
circuit. is is known as the
onboard LED, and you can nd
one on almost any Arduino or
Arduino-compatible board. In
most cases, this LED is connected
to digital pin 13 (D13), the
same pin used in this circuit.
CODE TO NOTE
SETUP AND LOOP:
void setup(){} &
void loop(){}
Every Arduino program needs these two functions. Code that goes in
between the curly brackets {} of setup()runs once. e code in
between the loop()curly brackets {} runs over and over until the
RedBoard is reset or powered o.
INPUT OR OUTPUT?:
pinMode(13, OUTPUT);
Before you can use one of the digital pins, you need to tell the RedBoard
whether it is an INPUT or OUTPUT. We use a built-in “function” called
pinMode() to make pin 13 a digital output. You’ll learn more about
digital inputs in Project 2.
PROGRAM OVERVIEW
Turn the LED on by sending power (5V) to digital pin 13.
Wait 2 seconds (2000 milliseconds).
Turn the LED off by cutting power (0V) to digital pin 13.
Wait 2 seconds (2000 milliseconds).
Repeat.
NEW IDEAS
CODE TO NOTE: e sketches that accompany each circuit introduce new programming techniques and
concepts as you progress through the guide. e Code to Note section highlights specic lines of code from the
sketch and explains them in greater detail.
This manual suits for next models
1
Other sparkfun Educational Equipment manuals
Popular Educational Equipment manuals by other brands

SURGLASSES
SURGLASSES Asclepius Quick setup guide

Enabling Devices
Enabling Devices 2249 user guide

Reality Works
Reality Works Joint Model Set quick start guide

HIK VISION
HIK VISION DS-9604LNI-V/B12 quick start guide

Keysight Technologies
Keysight Technologies U3851A Getting started guide

Sphero
Sphero LittleBits manual