Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By ptribbey
#60417 This may be obvious to some, but I know others will appreciate.
For the 12E module, the pin out for i2C is the gpio number, not the module pin number.

Also, the 1 wire interface is hard coded to gpio2, (pin17) for example: temp(#). where the # is the nth device.
I've only tried temp(0), and it works well.

i2c.setup(0,2) for example, wires the sda to gpio0 or pin 18, and sdc to gpio2 or pin 17.
I tried most of the available combinations, and was successful on all but gpio16(pin4). not sure why.
Paul
Last edited by ptribbey on Tue Jan 10, 2017 10:46 pm, edited 2 times in total.
User avatar
By martinayotte
#60422 Did you add external PullUps ?
GPIO16 doesn't have internal pullup, it has pulldown instead, so you need to add external one.

BTW, even if Wire library enable internal pullups, it is recommended to use external ones for better signal integrity.
User avatar
By ptribbey
#60442 I had 1k pullups, which is conservative, but even a 390 won't make pin 16 work. It really doesn't matter to me, I just wanted to prevent un needed frustration with someone trying to use that pin for I2C.
User avatar
By martinayotte
#60475 I've personally never tried I2C on GPIO16, so I thought it was only PullUp issue.
Maybe it is only related to ESPBasic, due to some other usage.
I will try in native ESPArduino when I get chance.