Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A24 arduino demo source code-07-analog out (DAC)
#1
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(){
}
   
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)