extern "C" { #include } #include "../global.h" #include "ds1803.h" DS1803::DS1803() { #ifdef WIRE_LIB_SCAN_MOD /*if (!Wire.isStarted())*/ Wire.begin(); #else Wire.begin(); #endif } /** * Instantiate the object **/ DS1803 DPOT = DS1803(); void DS1803::setWiper(uint8_t value, uint8_t wiperAddr) { if (!Wire.checkAddress(DPOT_WADDR)) return; Wire.beginTransmission(DPOT_WADDR); Wire.send(wiperAddr); // Send the wiper address Wire.send(value); Wire.endTransmission(); } /* uint8_t DS1803::getValue() { if (!Wire.checkAddress(DPOT_WADDR)) return; Wire.requestFrom(DPOT_RADDR, 2); while (Wire.available()) { Serial.println((uint8_t)Wire.receive(), DEC); } return 0; } */