Skip to content

Conversation

@fritzen
Copy link

@fritzen fritzen commented Mar 2, 2020

Motivation
This change was motivated by the incompatibility of ESP32-CAM hardware, which has no exposed sda / scl pins:

Changes

  • Added sda and scl parameters for the begin method.
  • Compatibility is maintained

Tests

  • pwm.begin(255); //prescale - OK
  • pwm.begin(2,14); //2=SDA, 14=SCL - OK
  • pwm.begin(2,14, 255); //2=SDA, 14=SCL, 255=prescale - OK
  • pwm.begin(); - OK

@ladyada
Copy link
Member

ladyada commented Mar 2, 2020

will not merge

see: adafruit/Adafruit_BME280_Library#62
adafruit/Adafruit_MCP9808_Library#23
adafruit/Adafruit_BMP280_Library#38

please tell the ESP BSP supporters to add a function called, like, setPins() to Wire, because the official arduino Wire library does not allow what they have added

@ladyada ladyada closed this Mar 2, 2020
@fritzen
Copy link
Author

fritzen commented Mar 2, 2020

Sure.. it`s incompatible with Arduino Wire.

I modified the code below to make it compatible with ESP32-CAM.

  #ifdef ESP32_CAM
        _i2c->begin(14,15);
  #else
        _i2c->begin();
  #endif

@ladyada
Copy link
Member

ladyada commented Mar 2, 2020

this works for you but will be difficult to maintain for us :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants