Added CV and Gate outputs via 2x i2c MCP4725 modules
This commit is contained in:
33
CV_Test/CV_Test.ino
Normal file
33
CV_Test/CV_Test.ino
Normal file
@ -0,0 +1,33 @@
|
||||
#include <Wire.h>
|
||||
#include "MCP4725.h"
|
||||
|
||||
MCP4725 DAC1(0x60);
|
||||
MCP4725 DAC2(0x61);
|
||||
|
||||
float output1 = 0;
|
||||
float output2 = 5.1;
|
||||
|
||||
void setup() {
|
||||
Wire.begin();
|
||||
DAC1.begin();
|
||||
DAC2.begin();
|
||||
DAC1.setMaxVoltage(5.1);
|
||||
DAC2.setMaxVoltage(5.1);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (output1 < 5.1) {
|
||||
output1 += 0.1;
|
||||
} else {
|
||||
output1 = 0;
|
||||
}
|
||||
DAC1.setVoltage(output1);
|
||||
|
||||
if (output2 > 0) {
|
||||
output2 -= 0.1;
|
||||
} else {
|
||||
output2 = 5.1;
|
||||
}
|
||||
DAC2.setVoltage(output2);
|
||||
delay(1);
|
||||
}
|
||||
Reference in New Issue
Block a user