What are the pros and cons of using the machine.I2C or pyb.I2C libraries? Looks like machine.I2C is more 'portable' across the different hardware that MicroPython can run on? Are there any other considerations?
thanks,
Chris
machine.I2C or pyb.I2C?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: machine.I2C or pyb.I2C?
The machine library is portable and includes the facility for software I2C. I recently ported a project from the pyb implementation to machine. This was straightforward and the outcome worked on the Pyboard and the ESP8266.
In other areas pyb offers better Pyboard support. My approach for new projects is to use machine where possible, importing pyb for functionality not yet incorporated in machine.
In other areas pyb offers better Pyboard support. My approach for new projects is to use machine where possible, importing pyb for functionality not yet incorporated in machine.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.