Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By epy hobb
#79433 HI,

i am trying to interface SSD1306 and MLX90614 i2c devices with ESP8266 mcu. but both devices are not working together..
if i comment out code for display then it is working for mlx90614.
Here is part of my code..

Code: Select all#include <Wire.h>
#include <Adafruit_MLX90614.h>
#include "SSD1306Wire.h"


Adafruit_MLX90614 mlx = Adafruit_MLX90614();
//SSD1306Wire  display(0x3c, D3, D4);

void setup() {
  Serial.begin(9600);
  Serial.println("Adafruit MLX90614 test"); 
  mlx.begin(); 
  Wire.begin(D2,D1);

  /************************************/
//  display.init();
////  display.setI2cAutoInit(true);
//  display.flipScreenVertically();
//  display.setFont(ArialMT_Plain_16);
//  display.drawString(128, 33, "Right aligned (128,33)");
}

void loop() {
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC());
  Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempF());
  Serial.print("*F\tObject = "); Serial.print(mlx.readObjectTempF()); Serial.println("*F");

  Serial.println();
  delay(500);
}
User avatar
By rudy
#79437 It seems to me that you are using different pins for each device. If that is the case, connect them in parallel. Both SDA and SCL pair to the same pins.


mlx.begin();
Wire.begin(D2,D1);

SSD1306Wire display(0x3c, D3, D4);
User avatar
By epy hobb
#79439
rudy wrote:It seems to me that you are using different pins for each device. If that is the case, connect them in parallel. Both SDA and SCL pair to the same pins.


mlx.begin();
Wire.begin(D2,D1);

SSD1306Wire display(0x3c, D3, D4);

I tried that way as well. Then later i selected different pins..then also not working...
User avatar
By AcmeUK
#79443 Have you got pull-up resistors on the SCL and SDA lines? 4K7 resistors are usually adequate.

Have you scanned the I2C bus to see what devices are found?

I2C devices have fixed or default addresses, is there an address clash?

Also from here :-http://www.esp8266.com/posting.php?mode=reply&f=32&t=18839
Did you read the datasheet of the MLX90614? The default operation mode of the chip is to put out a PWM signal on the SDA pin. If that is still enabled you cannot use the chip together with other devices on the same I2C bus.