aswersf
Dependents: p31_SerielDirectwithBytes_Generatoren_Rampe_Sinus_usw
Diff: FuncGenFSST3.h
- Revision:
- 0:2e0be62147b1
diff -r 000000000000 -r 2e0be62147b1 FuncGenFSST3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FuncGenFSST3.h Tue Apr 25 06:52:25 2017 +0000 @@ -0,0 +1,83 @@ + +#ifndef FuncGenFSST_h +#define FuncGenFSST_h + +//Sägezahn +class SingnedRampGen { + public: + float val; // momentaner Ausgangswert + private: + float _inc; + public: + SingnedRampGen(); + + void SetPointsPerPeriod(float aPoints); + + // bezogen auf Fsample 0..0.5 + void SetFrequ(float aFrequ); + + // Einen Abtastwert berechnen + // wird bei z.B. Fsample=100Hz 100x pro sec afgerufen + void CalcOneStep(); +}; + +//Dreieck +class TriangleGen { + public: + float val; // momentaner Ausgangswert + private: + float _inc; + int _state; + public: + TriangleGen(); + + void SetPointsPerPeriod(float aPoints); + + // bezogen auf Fsample 0..0.5 + void SetFrequ(float aFrequ); + + // Einen Abtastwert berechnen + void CalcOneStep(); +}; + +//Rechteck +class RectGen { + public: + float val; // momentaner Ausgangswert + private: + float _inc; + float _phase; + public: + RectGen(); + + void SetPointsPerPeriod(float aPoints); + + void SetFrequ(float aFrequ); + + // Dauer des ON-Pulses in Prozent ( 0..1 ) + void SetPulsWidth(float aPercent); + + // Einen Abtastwert berechnen + void CalcOneStep(); +}; + +#endif + + + + + + + + + + + + + + + + + + +