//****************Arduino code from video************
/*
* This code was used for a tutorial on how to build a simple eload with Arduino
* The Tutorial can be found on the ForceTronics YouTube Channel
* This code is public domain and free for anybody to use at their own risk
*/
void setup() {
pinMode(A0, OUTPUT); //A0 DAC pin to output
analogWriteResolution(10); //default DAC resolution is 8 bit, swith it to 10 bit (max)
}
void loop() {
//create pulsed current profile
analogWrite(A0, 16); //Set DAC to approximately 10mV --> current 10mV / 5ohm = 2 mA
delay(500);
analogWrite(A0,310); //Set DAC to 1V --> current 1V / 5ohm = 200 mA
delay(50);
}
I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot! Best Selfie Ring Lights in 2019 – LED Selfie Light For Smartphones
ReplyDeleteanalogWrite(A0, 16); //Set DAC to approximately 52mV not 10mV
ReplyDelete1023 ------> 3V3
16 ------> x = (3.3 * 16)/1023 = 0.0516 V