adds averaging

This commit is contained in:
2026-09-18 10:19:43 +00:00
parent 1abf1ddbc0
commit 9a42455588
2 changed files with 14 additions and 0 deletions

BIN
ina219

Binary file not shown.

View File

@@ -334,6 +334,20 @@ int main( int argc, char *argv[] )
exit( 1 ); exit( 1 );
} }
// START: FFX
// Aktiviert 128 Samples Averaging für Bus- und Shunt-ADC (Konfigurations-Bitmaske: 0x3FFF)
unsigned short config_val = 0x3FFF;
if ( register_write( CONFIG_REG, config_val ) != 0 )
{
fprintf( stderr, "Warnung: Averaging konnte nicht im Config-Register gesetzt werden.\n" );
}
else
{
// Dem ADC etwas Zeit geben, um die ersten gemittelten Samples zu sammeln (128 Samples dauern ca. 69ms)
msleep( 80 );
}
// END: FFX
switch ( operation ) switch ( operation )
{ {
case OP_DUMP: case OP_DUMP: