mirror of
https://github.com/rene-dev/stmbl.git
synced 2026-02-06 02:02:34 +08:00
+ac
This commit is contained in:
19
src/comps/ac.comp
Normal file
19
src/comps/ac.comp
Normal file
@@ -0,0 +1,19 @@
|
||||
COMP(ac);
|
||||
|
||||
HAL_PIN(in) = 0.0;
|
||||
HAL_PIN(ac) = 0.01;
|
||||
HAL_PIN(out) = 0.0;
|
||||
|
||||
MEM(float avg) = 0.0;
|
||||
|
||||
RT_FILTER(
|
||||
float i = PIN(i);
|
||||
float a = PIN(ac);
|
||||
|
||||
// avg
|
||||
avg = i * ac + avg * (1 - ac);
|
||||
|
||||
PIN(out) = i - avg;
|
||||
);
|
||||
|
||||
ENDCOMP;
|
||||
Reference in New Issue
Block a user