Rundungsfehlerkorrektur

This commit is contained in:
Fabian Schieder 2026-02-08 18:47:31 +00:00
parent 21d69d24b6
commit bb88c8d84d

8
main.c
View File

@ -355,11 +355,19 @@ int main(void)
if(leitungBenutzt) if(leitungBenutzt)
{ {
int time = 3000 / NACHLAUF; int time = 3000 / NACHLAUF;
int rest = 3000 % NACHLAUF;
uint8_t i = 0; uint8_t i = 0;
for(i = 0; i < NACHLAUF; i++) for(i = 0; i < NACHLAUF; i++)
{ {
wait_sys_ms(time); wait_sys_ms(time);
if(rest > 0)
{
wait_sys_ms(1);
rest -= 1;
}
nachlaufOffset += 1; nachlaufOffset += 1;
setFuellstand(istWert + nachlaufOffset); setFuellstand(istWert + nachlaufOffset);
} }