Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino demo source code for KC868-A4]-06 analog output (DAC) data
#1
Heart 
Code 5: //The demo code is DAC    You can copy the code to your Arduino IDE

Code:
#define DAC1 26   //DAC1 IO26
//#define DAC2 25   //DAC2 IO25

void setup() {
 
}

void loop() {
  int Value = 127; //255= 10V
 
  dacWrite(DAC1, 1);
  delay(500);
  dacWrite(DAC1, 50);
  delay(500);
  dacWrite(DAC1, 100);
  delay(500);
  dacWrite(DAC1, 150);
  delay(500); 
  dacWrite(DAC1, 255);
  delay(500); 
}
   
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)