noise reject
This commit is contained in:
parent
b25c472854
commit
257a226f0e
1 changed files with 4 additions and 0 deletions
|
|
@ -19,6 +19,10 @@ CurrentTransformerCard ct6 = CurrentTransformerCard(&analogCard, 7, &voltage, &a
|
||||||
float adc2current(uint16_t adc_val)
|
float adc2current(uint16_t adc_val)
|
||||||
{
|
{
|
||||||
// float voltage = adc_val * 0.0007-0.1994;
|
// float voltage = adc_val * 0.0007-0.1994;
|
||||||
|
if (adc_val > 64000) {
|
||||||
|
// ADC Value is too high, return 0
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
float adc_voltage = adc_val * 0.0007;
|
float adc_voltage = adc_val * 0.0007;
|
||||||
// 0-10V Output with 30A Current Rating CT
|
// 0-10V Output with 30A Current Rating CT
|
||||||
float ct_current = adc_voltage / 10.0 * 30.0;
|
float ct_current = adc_voltage / 10.0 * 30.0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue