All Projects → xreef → PCF8575_library

xreef / PCF8575_library

Licence: MIT, Unknown licenses found Licenses found MIT LICENSE Unknown LICENSE.md
Library to use i2c digital expander with arduino, esp8266 and esp32. Can read write digital value with only 2 wire (perfect for ESP-01).

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to PCF8575 library

Ssd1306
Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms
Stars: ✭ 303 (+982.14%)
Mutual labels:  esp8266, i2c, esp32, arduino-library
Espmqttclient
Wifi and MQTT handling for ESP8266 and ESP32
Stars: ✭ 169 (+503.57%)
Mutual labels:  esp8266, esp32, arduino-library
Pzem004t
Arduino communication library for Peacefair PZEM-004T Energy monitor
Stars: ✭ 165 (+489.29%)
Mutual labels:  esp8266, esp32, arduino-library
Easybutton
Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.
Stars: ✭ 187 (+567.86%)
Mutual labels:  esp8266, esp32, arduino-library
Esp8266 Oled Ssd1306
Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
Stars: ✭ 1,590 (+5578.57%)
Mutual labels:  esp8266, i2c, esp32
Irremoteesp8266
Infrared remote library for ESP8266/ESP32: send and receive infrared signals with multiple protocols. Based on: https://github.com/shirriff/Arduino-IRremote/
Stars: ✭ 1,964 (+6914.29%)
Mutual labels:  esp8266, esp32, arduino-library
Arduino Applemidi Library
Send and receive MIDI messages over Ethernet (rtpMIDI or AppleMIDI)
Stars: ✭ 177 (+532.14%)
Mutual labels:  esp8266, esp32, arduino-library
Aunit
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test. Used with AUniter or EpoxyDuino for continuous builds.
Stars: ✭ 73 (+160.71%)
Mutual labels:  esp8266, esp32, arduino-library
Dsckeybusinterface
An Arduino/esp8266/esp32 library to directly interface with DSC security systems.
Stars: ✭ 202 (+621.43%)
Mutual labels:  esp8266, esp32, arduino-library
Arduinowebsockets
A library for writing modern websockets applications with Arduino (ESP8266 and ESP32)
Stars: ✭ 213 (+660.71%)
Mutual labels:  esp8266, esp32, arduino-library
Pixie Chroma
Arduino library and documentation for Pixie Chroma displays!
Stars: ✭ 33 (+17.86%)
Mutual labels:  esp8266, esp32, arduino-library
Pagebuilder
An arduino library to create html string in the sketch for ESP8266/ESP32 WebServer.
Stars: ✭ 104 (+271.43%)
Mutual labels:  esp8266, esp32, arduino-library
Wifiespnow
ESP-NOW Arduino library for ESP8266 and ESP32
Stars: ✭ 90 (+221.43%)
Mutual labels:  esp8266, esp32, arduino-library
Split Single Phase Energy Meter
Split Single-phase Energy Meter
Stars: ✭ 158 (+464.29%)
Mutual labels:  esp8266, esp32, arduino-library
Tft espi
Arduino and PlatformIO IDE compatible TFT library optimised for the STM32, ESP8266 and ESP32 that supports different driver chips
Stars: ✭ 1,215 (+4239.29%)
Mutual labels:  esp8266, esp32, arduino-library
Influxdb Client For Arduino
Simple library for sending measurements to an InfluxDB with a single network request. Supports ESP8266 and ESP32.
Stars: ✭ 176 (+528.57%)
Mutual labels:  esp8266, esp32, arduino-library
PCF8574 library
i2c digital expander for Arduino, esp32, SMT32 and ESP8266. Can read write digital values with only 2 wire. Very simple to use and encoder support.
Stars: ✭ 145 (+417.86%)
Mutual labels:  digital, i2c, expander
Arduinojson
📟 JSON library for Arduino and embedded C++. Simple and efficient.
Stars: ✭ 5,456 (+19385.71%)
Mutual labels:  esp8266, esp32, arduino-library
Sx126x Arduino
Arduino library to use Semtech SX126x LoRa chips and modules to communicate
Stars: ✭ 55 (+96.43%)
Mutual labels:  esp8266, esp32, arduino-library
Esp Webota
Simple web based Over-the-Air (OTA) updates for ESP based projects
Stars: ✭ 189 (+575%)
Mutual labels:  esp8266, esp32, arduino-library
Support forum pcf8575 English
Forum supporto pcf8575 italiano

###Additional information and document update here on my site: pcf8575 Article.

###If you need less pins here you can find pcf8574 discrete 8bit version of the IC.

Library to use i2c analog IC with arduino and esp8266. Can read and write digital value with only 2 wire (perfect for ESP-01).

06/04/2022: v1.0.3 Fix package size

Tutorial:

To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder PCF8575. Check that the PCF8575 folder contains PCF8575\\.cpp and PCF8575.h. Place the DHT library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.

Reef complete PCF8575 PCF8575AP digital input and output expander with i2c bus.

I try to simplify the use of this IC, with a minimal set of operation.

PCF8575 address map 0x20 default

Constructor: you must pas the address of i2c (to check the adress use this guide I2cScanner)

	PCF8575(uint8_t address);

for esp8266 if you want specify SDA e SCL pin use this:

	PCF8575(uint8_t address, uint8_t sda, uint8_t scl);

You must set input/output mode:

	pcf8575.pinMode(P0, OUTPUT);
	pcf8575.pinMode(P1, INPUT);
	pcf8575.pinMode(P2, INPUT);

then IC as you can see in the image have 8 digital input/output:

PCF8575 schema

So to read all analog input in one trasmission you can do (even if I use a 10millis debounce time to prevent too much read from i2c):

	PCF8575::DigitalInput di = PCF8575.digitalReadAll();
	Serial.print(di.p0);
	Serial.print(" - ");
	Serial.print(di.p1);
	Serial.print(" - ");
	Serial.print(di.p2);
	Serial.print(" - ");
	Serial.println(di.p3);

To follow a request (you can see It on issue #5) I create a define variable to work with low memori device, if you decomment this line on .h file of the library:

// #define PCF8575_LOW_MEMORY

Enable low memory props and gain about 7byte of memory, and you must use the method to read all like so:

   byte di = pcf8575.digitalReadAll();
   Serial.print("READ VALUE FROM PCF: ");
   Serial.println(di, BIN);

where di is a byte like 11100011110001, so you must do a bitwise operation to get the data, operation that I already do in the "normal" mode, here an example:

   p0 = ((di & bit(0))>0)?HIGH:LOW;
   p1 = ((di & bit(1))>0)?HIGH:LOW;
   p2 = ((di & bit(2))>0)?HIGH:LOW;
   p3 = ((di & bit(3))>0)?HIGH:LOW;
   p4 = ((di & bit(4))>0)?HIGH:LOW;
   p5 = ((di & bit(5))>0)?HIGH:LOW;
   p6 = ((di & bit(6))>0)?HIGH:LOW;
   p7 = ((di & bit(7))>0)?HIGH:LOW;

if you want read a single input:

	int p1Digital = PCF8575.digitalRead(P1); // read P1

If you want write a digital value you must do:

	PCF8575.digitalWrite(P1, HIGH);

or:

	PCF8575.digitalWrite(P1, LOW);

You can also use interrupt pin: You must initialize the pin and the function to call when interrupt raised from PCF8575

	// Function interrupt
void keyPressedOnPCF8575();

// Set i2c address
PCF8575 pcf8575(0x39, ARDUINO_UNO_INTERRUPT_PIN, keyPressedOnPCF8575);

Remember you can't use Serial or Wire on interrupt function.

The better way is to set only a variable to read on loop:

void keyPressedOnPCF8575(){
	// Interrupt called (No Serial no read no wire in this function, and DEBUG disabled on PCF library)
	 keyPressed = true;
}

For the examples I use this wire schema on breadboard: Breadboard

Test pcf8575

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].