Skip to content

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

@wayoda

Description

@wayoda

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions