EasyManua.ls Logo

DFRobot FIREBEETLE BOARD-ESP32 - Page 42

DFRobot FIREBEETLE BOARD-ESP32
49 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Welcome to DFRobot: www.DFRobot.com.cn 42 / 49
}
for(int j=10;j>0;j--){
dacWrite(D2,j*25);
delay(200);
}
}
Please click verify/compile to review and please upload it after the confirmation.
Once you click Upload, IDE will send codes to FireBeetle Board-ESP32.
Once the upload finishes, use an oscilloscope to test the voltage of D2, trapezium wave shown as
below.
Code analysis:
As we see, the operation of DAC in Arduino is convenient, just call dacWrite. The antitype of
dacWrite is as below:
void dacWrite(uint8_t pin, uint8_t value)
Pin is the digital output interface of DAC, D2/D3; Value is the output number, from 0 to 255, the
corresponding voltage value is 0 to Vcc.