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
A1
A0
IIC Address
0
0
0
0x20 (Default)
0
0
1
0x21
0
1
0
0x22
0
1
1
0x23
1
0
0
0x24
1
0
1
0x25
1
1
1
0x26
1
1
1
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
ioport.pinMode(7, OUTPUT); //Set GPIOs pinMode LED
16
ioport.pinMode(8, INPUT);
//Button
17 }
18
19 void loop()
20 {
21
if (ioport.digitalRead(ED8) == LOW) {
22
23
ioport.digitalWrite(7, LOW);
//Turn off Led
}
24
25
if (ioport.digitalRead(ED8) == HIGH) {
26
27
ioport.digitalWrite(7, HIGH);
}
28
29 }
Library Explanation
Library Functions
pinMode() same as standard Arduino
digitalRead() same as Arduino
digitalWrite() same as Arduino
//Turn on Led
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
很抱歉,暂时无法提供与“DFR0013”相匹配的价格&库存,您可以联系我们找货
免费人工找货