IIC to GPIO Shield V2.0 SKU: DFR0013
Contents
1 Introduction
2 Specification
3 Board Overview
4 Tutorial
4.1 Requirements
4.2 Connection Diagram
4.3 Sample Code
5 Library Explanation
5.1 Library Functions
5.2 Pin map
6 FAQ
Introduction
Having troubles with inadequate digital I/O when using Arduino with robots or interactive media?
This IIC to GPIO shield helps you solve the problem, Arduino has only two data lines (SCL-Analog
PIN5, SDA-Analog PIN4) and IIC can transfer I / O module communication, to convert the 16 digital
IO ports, read-write. 8 simultaneous parallel modules, each module can be set to address.
Specification
Module power supply: +5 V
16 Digital I/O port comes with internal pull-up
Can be set to eight addresses (address range of 0x20 ~ 0x27)
8 modules simultaneously in parallel (IIC bus need to pull together)
Module Size: 56x53mm (2.21x2.08 in)
Board Overview
Plug
=
0
Unplug
=
1
A2
0
0
0
0
1
1
1
1
A1
0
0
1
1
0
0
1
1
A0
0
1
0
1
0
1
1
1
IIC Address
0x20 (Default)
0x21
0x22
0x23
0x24
0x25
0x26
0x27
Tutorial
Requirements
Hardware
DFRduino UNO
x1
IIC to GPIO Shield V2.0
x1
Button module
LED module
Software
Arduino IDE V1.6.5
Click to Download Arduino IDE from Arduino®
Connection Diagram
Sample Code
In this section, we will use an Arduino library written by nicoverduin
Github Library. About Library installation.
1 #if defined(ARDUINO) && ARDUINO >= 100
2 #include "Arduino.h"
3 #else
4
4 #include "WProgram.h"
5 #endif
6
7 #include "clsPCA9555.h"
8 #include "Wire.h"
9
10
11 PCA9555 ioport(0x20);
12
13 void setup()
14 {
15
16
17 }
18
19 void loop()
20 {
21
22
23
24
25
26
27
28
29 }
}
if (ioport.digitalRead(ED8) == HIGH) {
ioport.digitalWrite(7, HIGH);
//Turn on Led
}
if (ioport.digitalRead(ED8) == LOW) {
ioport.digitalWrite(7, LOW);
//Turn off Led
ioport.pinMode(7, OUTPUT); //Set GPIOs pinMode LED
ioport.pinMode(8, INPUT);
//Button
Library Explanation
Library Functions
pinMode()
same as standard Arduino
digitalRead()
same as Arduino
digitalWrite()
same as Arduino
Pin map
P0.0~P0.7 map to GPIO 0 ~ 7 or ED0 - ED7
P1.0~P1.7 map to GPIO 8 ~ 15 or ED8 - ED15
FAQ
There are no questions about this product yet. If you have any problems or suggestions, you are
welcome to email us or post on the DFRobot forum!
For any questions/advice/cool ideas to share, please visit the
DFRobot Forum.
Powered By DFRobot © 2008-2017