I want to start writing some more ESPBasic I2C related drivers and examples for widely used I2C compatible IC's, like ADC's, DAC's, Sensors, port expanders, etc but I really like to use other GPIO pins for the SDA/SCL lines. For this feature working we need a way to be able to define at the beginning of the program the allocated I2C pins like it is in Arduino IDE or even in LUA.
A simple way is to declare the desired SDA and SCL pins definitions to the start of the program:
I know that in ESPBasic we have hardcoded values for SDA and SCL as below:
Wire.begin(0, 2);
If this can be changed to
Wire.begin(SDA, SCL);
I think this is a quite simple feature to add and will made many people to adopt ESPBasic for their I2C related projects. GPIO0/2 are not exactly the most used pins for I2C out in the wild and might vary a lot based on projects needs.
Thank you,
TJ.
Available on Tindie: https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/