Arduino Course 02
Arduino Course 02
Jiang Jiang
TVETI at A.A. 2019
Liquid Crystal Display
Chinese LCD
I2C Bus Communication Protocol
What is I2C:
- Inter Integrated Circuit
The reference design is a bus with a clock (SCL) and data (SDA) lines with 7-bit
addressing. The bus has two roles for nodes: master and slave.
1602LCD Uno
Build Circuit GND GND
Type B
VCC 5V
Type A SDA SDA
SCL SCL
Find LCD Address
Type sketch as figure or download and run
‘I2C_find_address.ino’, then get LCD address in ‘Serial
monitor’.
Install Libraries
• Libraries provide extra functionality for use in sketches, e.g. working
with hardware or manipulating data.
• We can search libraries online.
Install Libraries
• Or download libraries from https://www.arduinolibraries.info/
Install Libraries
• Or download libraries from https://www.arduinolibraries.info/
Install Libraries
• Get LiquidCrystal_I2C.zip file
Color OLED
128×64 monochrome OLED
SSD1306 Uno
GND GND
VCC 3.3V
SDA SDA
SCL SCL
Find I2C Address
• Run ‘I2C_find_address.ino’ and find address
Install Libraries
• Install ‘Adafruit_GFX_Library’ and ‘Adafruit_SSD1306’
Functions of Adafruit_GFX_Library
Function Name Explanation
setCursor(x, y) set text cursor location
setTextColor() parameter WHITE for the dark background and BLACK for bright background
setTextSize() Set font size (starting from 1)
Static Text Sketch
create an object of
Adafruit_SSD1306 with I2C
Bitmap
Code
Displaying Bitmap
1. Run ‘image2cpp’
2. Select image
Displaying Bitmap
3. Copy code
4. Paste code