Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Multiple I2C devices when using BusIO
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Multiple I2C devices when using BusIO

by Joseph_Chase on Sat Apr 17, 2021 4:20 pm

In this application I want to use the SGP30 Gas Sensor on an Arduino rover and write the results to an onboard LCD. I have read the sensor results with the Serial Monitor. When I try to write to the LCD Display I get no data.

#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_I2CRegister.h>
#include <Adafruit_SPIDevice.h>

#include <Wire.h>
#include "Adafruit_SGP30.h"
#include <LiquidCrystal_PCF8574.h>
LiquidCrystal_PCF8574 lcd(0x27);
Adafruit_SGP30 sgp;

The LCD library is the only one that I could find that worked with my cheap display (in order to be affordable to my students). Is there a conflict on the I2C bus?

Joseph_Chase
 
Posts: 1
Joined: Sat Apr 17, 2021 3:57 pm

Re: Multiple I2C devices when using BusIO

by adafruit_support_carter on Mon Apr 19, 2021 12:16 pm

The default address for the SGP30 is 0x58:
https://github.com/adafruit/Adafruit_SG ... GP30.h#L29
So it's not an address conflict. It may have something to do with how the LiquidCrystal_PCF8574 library is using the I2C bus. Maybe it's not releasing it for use by the SGP30?

Is it still printing sensor data in the Serial Monitor OK? Try sending to both - Serial Monitor and LCD. That way you can watch the Serial Monitor as a backup.

adafruit_support_carter
 
Posts: 20120
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.