D-0006: Difference between revisions
Jump to navigation
Jump to search
Line 7: | Line 7: | ||
==Features== | ==Features== | ||
* PCF8574T Chip | |||
* I2C interface | |||
* 8-bit parallel port | |||
* Potentiometer Backlight control | |||
* LED jumper switch | |||
* Default I2C address: 0x27 | |||
==Gallery== | ==Gallery== | ||
==Package Includes== | ==Package Includes== |
Revision as of 13:51, 19 March 2020
PCF8574T LCD Driver Board
Description
The PCF8574T IO Expansion Board is used as remote 8-bit I/O expander for I2C-bus.
Up to 8 PCF8574T IO Expansion Board can be connected to the I2C-bus, providing up to 64 I/O ports.
The PCF8574T IO Expansion Board features allowing the use of multi module connected to the I2C bus at the same time by connecting the pinheader and connector.
There is a small potentiometer onboard, which can adjust the backlight of LCD1602 or LCD2004, and a jumper cap to control the switch of the LED light.
Features
- PCF8574T Chip
- I2C interface
- 8-bit parallel port
- Potentiometer Backlight control
- LED jumper switch
- Default I2C address: 0x27
Gallery
Package Includes
Reference
- PCF8574T Chip Datasheet: File:PCF8574T Datasheet.pdf
- WiringPi: [ http://wiringpi.com/extensions/i2c-pcf8574/ ]
- telecnatron:[ https://telecnatron.com/articles/Utility-To-Control-1602-LCD-On-Raspberry-Pi-Via-A-PCF8574-I2C-Backpack-Module/index.html]
- Circuitbasics:[ https://www.circuitbasics.com/raspberry-pi-i2c-lcd-set-up-and-programming/ ]
Demo Code For Handle PCF8574T
- Download and reinstall wiringPi liberary
sudo apt -y purge wiringpi hash -r cd /tmp wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb
- C++ language
#include <stdio.h> #include <time.h> #include <string> #include <wiringPi.h> #include <pcf8574.h> using namespace std; int main (int argc, char *argv[]){ printf("Raspberry Pi initializing...\n"); wiringPiSetup(); pcf8574Setup(100, 0x38); for (int i = 0; i < 8; ++i){ pinMode(100 + i, OUTPUT); } int b=0; while( 1==1 ){ printf("LOOP %u\n", b); for (int i = 0; i < 8; ++i){ digitalWrite(100 + i, i==b ? 0 : 1); } b++; if( b >= 8 ) b=0; delay(1000); } delay(1000); digitalWrite(100 + 0, 0); delay(1000); digitalWrite(100 + 0, 1); return 0; }
- Compile and run it.
g++ pcf8574.cpp -o pcf8574 -lwiringPi -std=c++11 ./pcf8574