Files

  • Not Found
  • Invalid object requested. SHA must identify a commit or a tree.
Last update 3 years 11 months by Stephen Crane
Files
data
cad
.gitignore
LICENSE
Makefile
PSU.ino
README.md
configuration.cpp
configuration.h
dbg.h
label.cpp
label.h
rssi.h
smoother.h
stator.h
smoother.h
#ifndef __SMOOTHER_H__ #define __SMOOTHER_H__ template<size_t N> class Smoother { public: Smoother(): _next(0) {} void add(float f) { float o = _samples[_next]; _samples[_next++] = f; if (_next == N) _next = 0; _sum = _sum + f - o; } float get() { return _sum / N; } private: float _samples[N]; float _sum; unsigned _next; }; #endif
Report a bug