You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I'd suggest doing what's done here: https://github.com/espruino/EspruinoDocsĀ­/blob/master/devices/LIS2DH12.js#L135

    I've started using that pattern on new modules - basically having two connect... functions, and passing read and write functions into the constructor. I believe it's actually faster than the previous method as well.

    In that case I'd keep the I2C function called just connect so it doesn't break existing code, but you could change the implementation such that the optional address could be supplied - which is always a nice bonus.

About

Avatar for Gordon @Gordon started