Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Limiter.cpp
00001 #include "mbed.h" 00002 #include "Limiter.h" 00003 00004 Limiter::Limiter(float RATE) 00005 { 00006 _rate = RATE; 00007 _lastval = 0.0; 00008 } 00009 00010 void Limiter::setup(float _cutoffreq,float _interval) 00011 { 00012 _period = 1 / _cutoffreq; 00013 _rate = _period / ( _period + _interval ); 00014 _lastval = 0.0; 00015 } 00016 00017 float Limiter::calc(float _now) 00018 { 00019 _lastval = _rate * _lastval + ( 1 - _rate ) * _now; 00020 return _lastval; 00021 } 00022 ;
Generated on Wed Jul 13 2022 09:20:34 by
1.7.2