m5stack / M5StickC

M5StickC Arduino Library
MIT License
477 stars 222 forks source link

I2c pins override #69

Closed beckmx closed 4 years ago

beckmx commented 4 years ago

Hello, quick question, I have a library, specifically the CCS811 from adafruit, it is using the default pins, I would like to override the pins or know what i2c pins are really defined for the stick-c

tanakamasayuki commented 4 years ago

Hi.

https://github.com/espressif/arduino-esp32/blob/master/variants/m5stick_c/pins_arduino.h#L17-L18 static const uint8_t SDA = 32; static const uint8_t SCL = 33;

My recommendation is to declare and use. Wire.begin(32, 33); or Wire.begin(0, 26);

beckmx commented 4 years ago

Got it, so it was the grove section, however something seems to happend, I tested under esp8266 and the library works well, in fact they have this lines:

Wire.begin();
    #ifdef ESP8266
    Wire.setClockStretchLimit(500);
    #endif

I was wondering how to do the same in the m5stick, aparently if I do the same, the compiler doesn't recognize that method