#include <DFRobot_GP8XXX.h>

DFRobot_GP8211S GP8211S;

void setup() {

  Serial.begin(9600);

  while(GP8211S.begin()!=0){
    Serial.println("Connection Failed!");
    delay(1000);
  }
  GP8211S.setDACOutRange(GP8211S.eOutputRange5V);
 //GP8211S.setDACOutRange(GP8211S.eOutputRange5V);

  delay(100);

  //Save the set voltage in the chip's internal memory for power loss recovery.
  //GP8211S.store();
}

void loop() { // 15 BIT RES give total steps of 32767 and A Voltage resolution of 152uV at 5volts Vref. 
  GP8211S.setDACOutVoltage(6553);     // 1V 
  delay(1000);
  GP8211S.setDACOutVoltage(13106);    // 2V
  delay(1000);
  GP8211S.setDACOutVoltage(19660);    // 3V
  delay(1000);
  GP8211S.setDACOutVoltage(26213);    // 4V
  delay(1000);
  GP8211S.setDACOutVoltage(32767);    // 5V
  delay(1000); 
}
