adafruit / Adafruit-MLX90614-Library

Arduino library for the MLX90614 sensors in the Adafruit shop
Other
128 stars 97 forks source link

M5StickC NCIR Hat has SDA 0, SCL 26. But the defualt SDA(32) and SCL(33) cannot be changed. #17

Closed iotmaker-cc closed 4 years ago

iotmaker-cc commented 4 years ago

Thank you for opening an issue on an Adafruit Arduino library repository. To improve the speed of resolution please review the following guidelines and common troubleshooting steps below before creating the issue:

If you're sure this issue is a defect in the code and checked the steps above please fill in the following fields to provide enough troubleshooting information. You may delete the guideline and text above to just leave the following details:

ladyada commented 4 years ago

please chat with m5stack so they can update their documentation

iotmaker-cc commented 4 years ago

please chat with m5stack so they can update their documentation

I think it is not the problem on M5stack documentation.

My recommendation is that your begin() method needs additional arguments to set new SDA and SCL pin number for general purpose.

ladyada commented 4 years ago

that is not standard usage for Arduino, m5stack needs to update their core to have a default I2C port

iotmaker-cc commented 4 years ago

that is not standard usage for Arduino, m5stack needs to update their core to have a default I2C port

I understand what you say. In case of ESP32, I2C pins can be allocated dynamically, and can have two I2C pins at the same time. So it is better your begin() method can choose I2C pins. M5StickC has one grove connector (pin no 32,33) and it can be used as default I2C, but it has other pins(pin no 0,26) on the head side that can be used as another I2C. Their NICR hat is attached on the head side, and it uses second I2C. So it is better for your begin() method to have arguments to select I2C pins.

At this time, to solve the problem I can use Wire.begin(0,26) instesd of using your mlx.begin().

Regards.

ladyada commented 4 years ago

you can use setPins https://github.com/espressif/arduino-esp32/issues/3779

iotmaker-cc commented 4 years ago

you can use setPins espressif/arduino-esp32#3779

Thanks a lot !!!