forked from LupusNobilis/java-org.hwo
WIP161212
parent
4558ca16b0
commit
84d4cd221e
|
@ -2,6 +2,7 @@ package org.hwo;
|
||||||
|
|
||||||
public class Smoother {
|
public class Smoother {
|
||||||
|
|
||||||
|
private int lastValue;
|
||||||
private int summe;
|
private int summe;
|
||||||
private int wert;
|
private int wert;
|
||||||
private int tn;
|
private int tn;
|
||||||
|
@ -15,6 +16,7 @@ public class Smoother {
|
||||||
|
|
||||||
public int cycle(int value)
|
public int cycle(int value)
|
||||||
{
|
{
|
||||||
|
lastValue = value;
|
||||||
summe += value;
|
summe += value;
|
||||||
wert = summe / tn;
|
wert = summe / tn;
|
||||||
summe -= wert;
|
summe -= wert;
|
||||||
|
@ -46,6 +48,9 @@ public class Smoother {
|
||||||
this.tn = tn;
|
this.tn = tn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getLastValue(){
|
||||||
|
return lastValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue