Code:
#include "DFRobot_GP8403.h"
#include "Wire.h"
DFRobot_GP8403 dac(&Wire,0x58);
void setup() {
Serial.begin(115200);
Wire.begin(16,5);
while(dac.begin()!=0){
Serial.println("init error");
delay(1000);
}
Serial.println("init succeed");
//Set DAC output range
dac.setDACOutRange(dac.eOutputRange10V);
dac.setDACOutVoltage(10000, 0);
dac.setDACOutVoltage(10000, 1);
delay(1000);
//Store data in the chip
dac.store();
}
void loop(){
}