Serial monitor output not working after starting i2c wire library

youmebangbang
Posts: 3
Joined: Thu Aug 31, 2017 2:38 am

Serial monitor output not working after starting i2c wire library

Postby youmebangbang » Sun Sep 17, 2017 1:03 am

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.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Mon Sep 18, 2017 1:33 am

Moved to the Arduino subforum.

User avatar
martinayotte
Posts: 141
Joined: Fri Nov 13, 2015 4:27 pm

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

Postby martinayotte » Mon Sep 18, 2017 2:51 pm

Do you have PullUps on I2C lines ?

tele_player
Posts: 90
Joined: Sun Jul 02, 2017 3:38 am

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

Postby tele_player » Tue Sep 26, 2017 3:10 am

Wire.begin() must be called without an address to initialize ESP as I2C master.

Who is online

Users browsing this forum: No registered users and 151 guests