https://www.dfrobot.com/product-1780.html

https://www.dfrobot.com/wiki/index.php/Gravity:_Digital_1-to-8_I2C_Multiplexer_SKU:DFR0576

library: https://github.com/DFRobot/DFRobot_I2C_Multiplexer/archive/master.zip

github: https://github.com/DFRobot/DFRobot_I2C_Multiplexer


Two i2c 2004A displays exampe

#include <DFRobot_I2CMultiplexer.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
/*Create an I2CMultiplexer object, the address of I2CMultiplexer is 0x70*/
DFRobot_I2CMultiplexer I2CMultiplexer(0x70);
LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup(){
    // Init display(s)
   for (uint8_t screen=0; screen<2; screen++) {
    I2CMultiplexer.selectPort(screen);
    lcd.init();                      // initialize the lcd 
    lcd.backlight();
    for (uint8_t sensor=0; sensor<4; sensor++) {
     lcd.setCursor(0,sensor);
     lcd.print(screen);
     lcd.setCursor(1,sensor);
     lcd.print(sensor                                              );     
     lcd.setCursor(3,sensor);
     lcd.print("t: xx.xx H: xx.xx");
    }
   } 
}
void loop(){
  
}
  • No labels