wayoda/micropython-mcp4725

micropython-mcp4725 is bloatware. We don't need a library for such a simple device

wayoda opened this issue · 0 comments

Yes, this is true!
But if someone is looking for a simple solution and is not running out of RAM in his project the library can make life a bit easier.

To simply make the DAC output something this would be enough

>>> from machine import I2C
>>> i2c=I2C(0,I2C.MASTER,pins=('GP15','GP14'))
>>> def writeToDac(value):
        buf=bytearray(2)
        buf[0]=(value >> 8) & 0xFF
        buf[1]=value & 0xFF
        i2c.writeto(0x62,buf)
>>> writeToDac(2048)