B4X FEED several i2c devices on single bus

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: several i2c devices on single bus است. این موضوع تا کنون 37 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع several i2c devices on single bus
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
37
پسندها
0
آخرین ارسال توسط PracticalSoft
Jun 6, 2020
11,559
4,422
Hi, All

What should be coding if several I2C devices are used on a single bus ?
I'm trying to use a sensor IC and LCD display, both are i2C, addresses are different, sure.

And they work OK only once: one measure and next printing to LCD. At next loop the sensor IC is not responding, and no printing also. Display cannot be reset until re-powering.

The sensor is controlled by rWire lib directly, the LCD is controlled by rLiquidCrystal_I2C lib (that uses I2C by C code, i guess). Each module initializes the I2C bus of ESP8266:
SDA = GPIO4 (D2)
SCL = GPIO5 (D1)

Addresses by the scanner are different for sure:
I2C device found at address: 0x27 (39) 'display
I2C device found at address: 0x38 (56) 'sensor
Click to expand...

Independently each device works OK in a loop. But how to use them both one by one correctly ?

 

عقب
بالا