Smart Home Automation Forum
DAC on the KC868-a6 - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-A6 (https://www.kincony.com/forum/forumdisplay.php?fid=22)
+--- Thread: DAC on the KC868-a6 (/showthread.php?tid=2988)



DAC on the KC868-a6 - Siebje - 06-16-2023

Hi, I'm working on a project where I need to control a 0-10V fan. I was going to use the two DAC channels on the KC868-a6 development board but without success. from the following code, I couldn't get a measurement with my multimeter  

Code:
/*KC868-A6 DAC CODE*/
#define DAC1 26
#define DAC2 25

void setup() {
  //Serial.begin(115200);

}

void loop() {

  dacWrite(DAC1, 127);
  dacWrite(DAC2, 127);

  delay(2000);

  dacWrite(DAC1, 255);
  dacWrite(DAC1, 255);

  delay(2000);
}
can someone help me with how to use the DAC?


RE: DAC on the KC868-a6 - admin - 06-16-2023

here is DAC arduino demo code for A6: https://www.kincony.com/forum/showthread.php?tid=1861
dacWrite(DAC2, 255); that means: output 10v
dacWrite(DAC2, 0); that means: output 0v
so you just need to replace the number will output different voltage.