假电容害死人那 皮上写着25v 47uf 实测10uf。。
用tone产生方波测阻抗求电容电感不现实 精度基本没有。。
现在电容用micros测 看到justinpiggy已经做了 这里我就[s:274](串口发到电脑显示 其它一样)
XXXXXXXXXXXXXXXXXXXXXXXX/t/40041int WaveOutPin=12;
int MeasureInPin=A0;
long a,b,c,length;
float k,Calibration,C,R;
int Ca,Cb;
float lo,hi;
void setup(){
XXXXXXXXXgin(9600); pinMode(WaveOutPin,OUTPUT);
digitalWrite(WaveOutPin,LOW);
k=1-exp(-1);
R=5000;
c=140;
delay(500);
}
void loop(){
lo=analogRead(MeasureInPin);
//digitalWrite(WaveOutPin,HIGH);
hi=1023;
digitalWrite(WaveOutPin,HIGH);
a=micros();
Calibration=(hi-lo)*k+lo;
while(1==1){
if (analogRead(MeasureInPin)>=Calibration) {
b=micros();
break;
}
}
digitalWrite(WaveOutPin,LOW);
delay(100);
C=((b-a-c))/R;
Ca=C;
Cb=(C-Ca)*100;
XXXXXXXXXintln(C,2);}