/* Blink led on PIN0 by Mischianti Renzo https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/ Permet de faire clignoter une LED sur la broche 0 */ #include "Arduino.h" #include "PCF8574.h" // Set i2c address PCF8574 pcf8574_1(0x20);// on peut en avoir 8 sur le bus I2C void setup() { Serial.begin(115200); delay(1000); // Set pinMode to OUTPUT pcf8574_1.pinMode(P0, OUTPUT); pcf8574_1.pinMode(P1, INPUT); Serial.print("Init pcf8574..."); if (pcf8574_1.begin()){ Serial.println("OK"); }else{ Serial.println("KO"); } } void loop() { pcf8574_1.digitalWrite(P0, HIGH); delay(1000); pcf8574_1.digitalWrite(P0, LOW); delay(1000); }