diff --git a/Template Project/src/analogdemo.cpp b/Template Project/src/analogdemo.cpp index a796b6e..7627678 100644 --- a/Template Project/src/analogdemo.cpp +++ b/Template Project/src/analogdemo.cpp @@ -1,4 +1,5 @@ #include +#define ADC void setup() { @@ -8,9 +9,14 @@ void setup() void loop() { + #ifdef DAC for(int i=0;i<4096;i++) { ESPMega_dacWrite(0,i); double dac_val_sine = 2047.5*sin(i*2*PI/2047.5)+2047.5; ESPMega_dacWrite(1,(int)dac_val_sine); } + #endif + #ifdef ADC + Serial.printf("A0: %d",ESPMega_analogRead(0)); + #endif } \ No newline at end of file