using the i2c lcd - rabbit robots1) wire the lcd display to the controller use your 4 jumper wires...

8
Using the I2C LCD Using I2C LCD V1.0 Circirculum Instructions Recommended Age: 12 and up Difficulty Level: 3/5 (Soldering Required, programming, connecting wires, small parts choking hazard) www.RabbitRobots.com WARNING: CHOKING HAZARD This kit contains small parts. Not suitable for children under 3 years

Upload: others

Post on 21-May-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using the I2C LCD - Rabbit Robots1) Wire the LCD display to the controller Use your 4 jumper wires to connect the I2C adaptor to the Arduino controller. Make sure to connect the GND

Using the I2C LCD

Using I2C LCD V1.0

Circirculum Instructions

Recommended Age: 12 and up

Difficulty Level: 3/5

(Soldering Required, programming, connecting wires, small parts – choking hazard)

www.RabbitRobots.com

WARNING: CHOKING HAZARD – This kit contains small parts. Not suitable for children under 3 years

Page 2: Using the I2C LCD - Rabbit Robots1) Wire the LCD display to the controller Use your 4 jumper wires to connect the I2C adaptor to the Arduino controller. Make sure to connect the GND

ID QTY Description Re-Order #

A 1 Arduino Uno or Mega controller

B 4 Jumper connector wires (Male – Female) BR-002

C 1 I2C adaptor board for LCD BR-003

D 1 2x16 LCD (Liquid Crystal Display) BR-004

E 1 USB Cable BR-005

F 1 Arduino IDE BR-006

G 1 NewLiquidCrystal_1,3,4.zip Library BR-007

Required Tools:

• Phillips #1 Screwdriver

• Soldering iron and solder (if the I2C adaptor is not already attached)

Extra Recommended Tools:

• Volt meter

This lesson is intended to help you start your education into robotics with the Arduino controller. This

lesson can be done with all parts out in the open… or while having other parts connected to an existing

robot kit. This is the beginning. Please take the opportunity to expand your skills to do many more

functions with the controller and LCD.

Additions you can do:

• Add two buttons to count up and count down.

Projects:

• Display information coming from the serial monitor

• Display an incrementing counter that “ticks” every second

• Blink the backlight on and off

• Create a screen saver to change characters of the display at random locations by Row and

Column.

• Advanced functions: Display the values from the analog pins of the Arduino controller.

Page 3: Using the I2C LCD - Rabbit Robots1) Wire the LCD display to the controller Use your 4 jumper wires to connect the I2C adaptor to the Arduino controller. Make sure to connect the GND

1) Wire the LCD display to the controller

Use your 4 jumper wires to connect the I2C adaptor to the Arduino controller.

Make sure to connect the GND of the I2C Adaptor to the GND of the controller. The Arduino Mega

uses Pin 21 for SCL and uses Pin 20 for SDA. The Arduino Uno uses the pins near the ICSP for SDA

and SCL.

Page 4: Using the I2C LCD - Rabbit Robots1) Wire the LCD display to the controller Use your 4 jumper wires to connect the I2C adaptor to the Arduino controller. Make sure to connect the GND

2) Install the LCD Library into the Arduino IDE

Download the NewLiquidCrystal_1.3.4.zip from the web site and copy into your PC.

Method 1) Use the Arduino IDE to select and install the library’s*.zip file to the folder identified

by the IDE.

Method 2) Unzip the library’s *.zip file and copy the entire contents to the special folder

“c:\Users\(user name)\Documents\Arduino\libraries”. Notice that the libraries folder should already be

in place and waiting for your new library folder.

Page 5: Using the I2C LCD - Rabbit Robots1) Wire the LCD display to the controller Use your 4 jumper wires to connect the I2C adaptor to the Arduino controller. Make sure to connect the GND

3) Download the INO file for testing

Download the LCD_I2C_LibTest.ino file from the RabbitRobots.com web site and copy into your PC. It

is easy to simply send the file to your “Downloads” directory, but it is really best to get your code files

organized. It doesn’t matter if you use a new folder of your main PC hard drive… or if you use a USB

flash drive. Your folder name must match the name of the INO file.

4) Connect the USB cable to the controller board.

Connect your USB cable from the controller board to the PC. You should hear a “bing” sound to

indicate the driver is loading. The driver will then appear in the Device Manager as a COM Port with

description of “Arduino Mega 2560 (COM?)”.

Page 6: Using the I2C LCD - Rabbit Robots1) Wire the LCD display to the controller Use your 4 jumper wires to connect the I2C adaptor to the Arduino controller. Make sure to connect the GND

5) Start the Arduino IDE

If your LCD_I2C_LibTest.ino file does NOT have the Arduino icon, then you may need to install the

Arduino IDE system. If you DO have the Arduino IDE installed but still have the wrong icon, the

“*.ino” extension is not associated with Arduino IDE. Open the LCD_I2C_LibTest.ino file by double

clicking on the filename or file icon. The Arduino IDE should start by showing the splash screen as seen

here.

6) Identify the correct COM port.

Use the menu to select [Tools] .. [Port: “COM3 (Arduino/Genuino Mega or Mega 2560)] .. or whichever

is appropriate to your COM port.

Page 7: Using the I2C LCD - Rabbit Robots1) Wire the LCD display to the controller Use your 4 jumper wires to connect the I2C adaptor to the Arduino controller. Make sure to connect the GND

7) Identify the correct control board.

Use the menu to select [Tools] .. [Board: “Arduino/Genuino Mega or Mega 2560”]. This is the

controller board that you have connected to your USB cable.

8) Compile and Upload the program.

Method 1) Click on the Circle/Arrow icon to Compile and Upload your program.

Method 2) Use the menu to select [Sketch] .. [Upload].

Page 8: Using the I2C LCD - Rabbit Robots1) Wire the LCD display to the controller Use your 4 jumper wires to connect the I2C adaptor to the Arduino controller. Make sure to connect the GND

9) Using the Backlight or NOT?

Use the small jumper to allow the I2C adaptor board to control the LED backlight for the LCD. If the

jumper is gone, the backlight will never turn on. The jumper is marked here with the RED circle. We

advise you to use the backlight.. but to turn it with software when you need to conserve battery life.

10) Adjust the LCD Contrast.

Use the small Phillips screwdriver to adjust the contrast. The contrast is changed by turning the small

potentiometer on back of the I2C adaptor board. The potentiometer is marked here with the green circle.

DONE….

* Advanced work: Open the serial monitor.. Set the baud rate to 9600… Send some text to the LCD.