Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why use i2c-bus versus i2c? #2

Open
dachshund-digital opened this issue Jun 26, 2020 · 2 comments
Open

Why use i2c-bus versus i2c? #2

dachshund-digital opened this issue Jun 26, 2020 · 2 comments

Comments

@dachshund-digital
Copy link

Why use i2c-bus versus i2c? You mention this in the read me, usage text. Just wondering why you did it?

@aphotix
Copy link
Owner

aphotix commented Jun 26, 2020

@dachshund-digital Great question. One of the big drivers was the fact that another project (fehmer/adafruit-i2c-lcd) I was depending on also used i2c-bus. I didn't want my project to use two different i2c packages. I also considered a few ancillary reasons:

  • i2c has not been updated in 4 years, whereas i2c-bus was updated 2 months ago
  • i2c-bus offers a more permissive MIT license (vs BSD-3) and I wanted my project and all dependencies to be very permissive
  • I found it very easy to use promises with i2c-bus (and by extension async/await) but found it more of a challenge with i2c. Granted if I tried again today I may not have the same challenges as I've learned a ton since I originally worked on this.

@dachshund-digital
Copy link
Author

dachshund-digital commented Jun 26, 2020

Very informative. I am just getting my feet wet with node-red, and am going to be writing a few node packages for some i2c sensors that as yet don't seem to be in npm for node-red. The bme280/bmp280 sensor is, but not the SHT3X for example. Unfortunately all my i2c experience is with python not nodejs. So I have some learning to do. Using your project as a guide, should be quite educational. I should just be able to create the node-red wrapper around your project.

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

No branches or pull requests

2 participants