Page 1 of 1

Serial monitor output not working after starting i2c wire library

Posted: Sun Sep 17, 2017 1:03 am
by youmebangbang
I am using the arduino IDE and want to get I2C data from a wii nunchuck controller. I am just trying to Serial.print() some values but nothing goes to the com viewer after wire is started.

Code: Select all

void setup() {
   Serial.begin(115200);
  Serial.println("HELLO");  
  
  Wire.begin(NUNCHUK_ADDRESS);

  Wire.beginTransmission(NUNCHUK_ADDRESS);
  Wire.write(0xF0);
  Wire.write(0x55);
  Wire.endTransmission();

  Wire.beginTransmission(NUNCHUK_ADDRESS);
  Wire.write(0xFB);
  Wire.write(0x00);
  Wire.endTransmission();

  Serial.println("end of setup");

}
It outputs "HELLO" but not "end of setup". Am I correct that wire and serial are default sharing something important in the esp32?
Thanks.

Re: Serial monitor output not working after starting i2c wire library

Posted: Mon Sep 18, 2017 1:33 am
by ESP_Sprite
Moved to the Arduino subforum.

Re: Serial monitor output not working after starting i2c wire library

Posted: Mon Sep 18, 2017 2:51 pm
by martinayotte
Do you have PullUps on I2C lines ?

Re: Serial monitor output not working after starting i2c wire library

Posted: Tue Sep 26, 2017 3:10 am
by tele_player
Wire.begin() must be called without an address to initialize ESP as I2C master.