|
24 | 24 | ======================================================== |
25 | 25 |
|
26 | 26 | CircuitPython module for the MCP4725 digital to analog converter. See |
27 | | -examples/simpletest.py for a demo of the usage. |
| 27 | +examples/mcp4725_simpletest.py for a demo of the usage. |
28 | 28 |
|
29 | 29 | * Author(s): Tony DiCola |
| 30 | +
|
| 31 | +Implementation Notes |
| 32 | +-------------------- |
| 33 | +
|
| 34 | +**Hardware:** |
| 35 | +
|
| 36 | +* Adafruit `MCP4725 Breakout Board - 12-Bit DAC w/I2C Interface |
| 37 | + <https://www.adafruit.com/product/935>`_ (Product ID: 935) |
| 38 | +
|
| 39 | +**Software and Dependencies:** |
| 40 | +
|
| 41 | +* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: |
| 42 | + https://github.com/adafruit/circuitpython/releases |
30 | 43 | """ |
31 | 44 | from micropython import const |
32 | 45 |
|
|
40 | 53 |
|
41 | 54 |
|
42 | 55 | class MCP4725: |
43 | | - """MCP4725 12-bit digital to analog converter. This class has a similar |
44 | | - interface as the CircuitPython AnalogOut class and can be used in place |
45 | | - of that module. |
| 56 | + """ |
| 57 | + MCP4725 12-bit digital to analog converter. This class has a similar |
| 58 | + interface as the CircuitPython AnalogOut class and can be used in place |
| 59 | + of that module. |
46 | 60 |
|
47 | | - :param ~busio.I2C i2c: The I2C bus. |
48 | | - :param int address: The address of the device if set differently from the default. |
| 61 | + :param ~busio.I2C i2c: The I2C bus. |
| 62 | + :param int address: The address of the device if set differently from the default. |
49 | 63 | """ |
50 | 64 |
|
51 | 65 |
|
@@ -97,12 +111,13 @@ def _read(self): |
97 | 111 |
|
98 | 112 | @property |
99 | 113 | def value(self): |
100 | | - """The DAC value as a 16-bit unsigned value compatible with the |
| 114 | + """ |
| 115 | + The DAC value as a 16-bit unsigned value compatible with the |
101 | 116 | :py:class:`~analogio.AnalogOut` class. |
102 | 117 |
|
103 | 118 | Note that the MCP4725 is still just a 12-bit device so quantization will occur. If you'd |
104 | | - like to instead deal with the raw 12-bit value use the raw_value property, or the |
105 | | - normalized_value property to deal with a 0...1 float value. |
| 119 | + like to instead deal with the raw 12-bit value use the ``raw_value`` property, or the |
| 120 | + ``normalized_value`` property to deal with a 0...1 float value. |
106 | 121 | """ |
107 | 122 | raw_value = self._read() |
108 | 123 | # Scale up to 16-bit range. |
|
0 commit comments