MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / writeDAC

Method writeDAC

libraries/MCP4725/MCP4725.cpp:116–123  ·  view source on GitHub ↗

unfortunately it is not possible to write a different value to the DAC and EEPROM simultaneously or write EEPROM only.

Source from the content-addressed store, hash-verified

114// unfortunately it is not possible to write a different value
115// to the DAC and EEPROM simultaneously or write EEPROM only.
116int MCP4725::writeDAC(const uint16_t value, const bool EEPROM)
117{
118 if (value > MCP4725_MAXVALUE) return MCP4725_VALUE_ERROR;
119 while(!ready());
120 int rv = _writeRegisterMode(value, EEPROM ? MCP4725_DACEEPROM : MCP4725_DAC);
121 if (rv == 0) _lastValue = value;
122 return rv;
123}
124
125
126uint16_t MCP4725::readDAC()

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64