Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1.   // wait for capacitor to charge ~63% (one T = RC)
  2.   while(true) {
  3.     float charge = analogRead(vTestPin)
  4.     elapsedTime= millis() - startTime;
  5.     if(charge > (ADC_RES * .63) {
  6.       microFarads = ((float)elapsedTime / resistorValue) * 1000;  
  7.     }
  8.     if(elapsedTime > 2000) {
  9.       microFarads = 0;
  10.     }
  11.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement