hi
i want read peak of ac 50 hz analog voltage .
i read pin voltage 500 times and get maximum readed vlotage
i think 50 hz means that in 20 ms i can read all of the voltage from 0 to maximum
i want to know how i can set analogread speed , that in 500 times reading pin voltage , read real maximum voltage ?
my code :
i want read peak of ac 50 hz analog voltage .
i read pin voltage 500 times and get maximum readed vlotage
i think 50 hz means that in 20 ms i can read all of the voltage from 0 to maximum
i want to know how i can set analogread speed , that in 500 times reading pin voltage , read real maximum voltage ?
my code :
B4X:
temp_read_max=0
Dim VTmp As Float
Dim Voltage,amps As Float
For avg = 1 To 10
For y = 1 To 500
VTmp = V_Pin_A0.AnalogRead
If VTmp > temp_read_max Then
temp_read_max = VTmp
End If
Next
temp_read_avg=temp_read_avg+temp_read_max
Delay(1)
Next
temp_read_avg=temp_read_avg/5