0% found this document useful (0 votes)
103 views

Step by Step Guide To The Arduino Leonardo

The document provides a step-by-step guide to using the Arduino Leonardo microcontroller board. It details that the Leonardo has more digital pins, analog pins, and PWM pins compared to the Arduino Uno. It also notes the Leonardo has built-in USB support, allowing it to function as a USB mouse or keyboard. The guide outlines the differences in serial ports, I2C pins, and provides tips for setting up the Leonardo board.

Uploaded by

MUSIC IS LIFE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

Step by Step Guide To The Arduino Leonardo

The document provides a step-by-step guide to using the Arduino Leonardo microcontroller board. It details that the Leonardo has more digital pins, analog pins, and PWM pins compared to the Arduino Uno. It also notes the Leonardo has built-in USB support, allowing it to function as a USB mouse or keyboard. The guide outlines the differences in serial ports, I2C pins, and provides tips for setting up the Leonardo board.

Uploaded by

MUSIC IS LIFE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Food Living Outside Play Technology Workshop

Step by Step Guide to the Arduino Leonardo


by ProvideYourOwn on June 27, 2012

Table of Contents

Step by Step Guide to the Arduino Leonardo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Step by Step Guide to the Arduino Leonardo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: More Digital Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Extra PWM pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3: More Analog Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4: SDA/SCL Pins are Different . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5: Serial Port Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 6: Keyboard and Mouse Emulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 7: Last Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

http://www.instructables.com/id/Step-by-Step-Guide-to-the-Arduino-Leonardo/
Author:ProvideYourOwn ProvideYourOwn.com
ProvideYourOwn.com is a website devoted to people who want to make their own things and provide for their own needs. We provide information,
encouragement and resources to empower people to become free from their limitations and bondage to industrialized society and its multi-national
corporations.

Intro: Step by Step Guide to the Arduino Leonardo


The Arduino team is now shipping their latest creation - the Leonardo. It is the first Arduino to use Atmel’s ATmegaXU4 series chip with built-in USB. This change is big
and it has big benefits. In addition to the built-in USB, it offers more digital and analog pins. This step by step guide gives you the details you need to know to start using
it.

For a more comprehensive guide, see my article - Arduino Leonardo versus Uno – What’s New .

Step 1: More Digital Pins


There are four more digital pins. The Uno has 14 digital pins: D0-D13. The Leonardo has 18: D0-D17. The extra pins have been mapped to the ICSP header. Their
mappings are:

D14 – MISO – PB3


D15 – SCK – PB1
D16 – MOSI – PB2
D17 – SS – PB0

Pin D17 (SS) does not have a corresponding pin on the ICSP header, nor anywhere on the board. In order to use it, you must solder a wire to either the end of the Rx
LED or the via attached to it - see photo.

http://www.instructables.com/id/Step-by-Step-Guide-to-the-Arduino-Leonardo/
Image Notes
1. attach here for D17 (SS)
2. or here for D17

Image Notes
1. D14
2. D15
3. D16

Step 2: Extra PWM pin


The Leonardo has 7 PWM pins instead of 6. ATmega32U4 also has a new timer, timer4 which has 10 bits and uses a PLL to count at 64MHz. Their mappings are
different as well:

D3: 8-bit timer0


D5: 16-bit timer1&3
D6: 10-bit timer4
D9: 16-bit timer1&3
D10: 16-bit timer1&3
D11: 8-bit timer0
D13: 10-bit timer4

Step 3: More Analog Pins


There are 12 analog input pins available on the Leonardo. The board has the same 6 analog pin header along the side for pins A0-A5. For the extra 6 pins (A6-A11), they
are located among the digital pin headers. They are marked with a dot on the top side of the board with the numbering drawn on the backside. As usual, analog pins can
also be used for digital I/O.

The correspondence of each analog with their digital counterparts is as follows:


A0 – D18
A1 – D19
A2 – D20
A3 – D21
A4 – D22
A5 – D23
A6 – D4
A7 – D6
A8 – D8
A9 – D9
A10 – D10
A11 – D12

http://www.instructables.com/id/Step-by-Step-Guide-to-the-Arduino-Leonardo/
Step 4: SDA/SCL Pins are Different
The pins supporting I2C/TWI previously used analog pins A4 & A5. Now these pins are located at digital pins D2 & D3. While the SDA and SCL pins are in the same
location on the board, because of the underlying hardware mapping changes, it may affect the operation of certain shields and any software using these two pins.

Image Notes
1. these are now pins D2 & D3

Step 5: Serial Port Differences


There is now a second serial port. The primary port is built into the USB interface and the Tx/Rx LEDs are attached to it. The secondary port is located at pins D0 & D1.
This port does not have any LEDs attached.

To use the primary serial port, use the class Serial as usual. For the secondary port, a new serial class called Serial1 has been created. You use it the same way as the
Serial class.

Step 6: Keyboard and Mouse Emulation


Of course the most exciting new feature is direct USB support. That means it can operate as an actual USB device. It can emulate a computer mouse, keyboard, or both.

The Arduino library has made it really easy to do by creating a two new classes - one for emulating a mouse, and the other a keyboard.

Step 7: Last Steps


There are two things you must do before using your new Leonardo board.

First, you must upgrade your Arudino IDE to version 1.01. It adds the support needed for this new board, plus it has a lot of nice new features.

Second, unless you are using Linux, you will need to install USB drivers for the Leonardo.

This step-by-step guide is a just a brief overview. For more detailed information, please see the article:

Arduino Leonardo versus Uno - What's New


It provides the extra details you need to make full use of the new Leonardo.

Related Instructables

ArduSensor Fun Powering the


Intro to Arduino Arduino Mega Arduino XMAS Quiz-O-Tron Biofeedback
Pack by 3000: Arduino Device based
by randofo with a Lithium hitcounter by
Qtechknow quiz contestant on Arduino
Battery by alex_weber
lockout system (Photos) by
inthebitz by RoysterBot neptunier

http://www.instructables.com/id/Step-by-Step-Guide-to-the-Arduino-Leonardo/

You might also like