Danny24 / ST7032_asukiaaa

ST7032.cpp - Arduino LiquidCrystal compatible library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ST7032_asukiaaa

A library to control ST7032 on a LiquidCrystal. This library was forked from tomozh/arduino_ST7032.

Install

Arduino IDE

You can install via library manager. Search ST7032 on the library manager

PlatformIO

Add this library to dependencies on platformio.ini.

lib_deps =
  ST7032_asukiaaa

Connection

ST7032 Arduino
VDD 3V3
RES 3V3
SDA* SDA(A4 for Uno)
SCL* SCL(A5 for Uno)
GND GND

*... 10Kohm pull-up is needed.

You can check SDA and SCL for your board on Wire page.

Usage

Hello world

See HelloWorld.

#include <ST7032_asukiaaa.h>

ST7032_asukiaaa lcd;

void setup() {
  lcd.begin(16, 2); // LCD columns and rows.
  lcd.setContrast(40);
  // If lcd become black, reduced value for contrast
  // lcd.setContrast(10);
  lcd.print("hello, world!");
}

void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis()/1000);
}

Set slave address

You can specify slave address for a LCD.

ST7032_asukiaaa lcd(0x3E);

Set wire

You can set customized wire.(See setWire)

#if defined(ESP32)
  Wire.begin(25, 26); // SDA, SCL
  lcd.setWire(&Wire);
#endif

See examples to know other usage.

License

Mainly MIT but some files on examples are CC.

References

About

ST7032.cpp - Arduino LiquidCrystal compatible library


Languages

Language:C++ 100.0%