Stefan Kiegerl
/
FuncGen17
Func-Gen - basic setup
Diff: FuncGenFSST_21.cpp
- Revision:
- 3:9fd12684fa88
- Parent:
- 2:3abf5ddd9fc0
diff -r 3abf5ddd9fc0 -r 9fd12684fa88 FuncGenFSST_21.cpp --- a/FuncGenFSST_21.cpp Tue Mar 23 17:06:24 2021 +0000 +++ b/FuncGenFSST_21.cpp Tue Mar 23 17:13:12 2021 +0000 @@ -1,14 +1,25 @@ #include "FuncGenFSST.h" - - +SignedRampGen::SignedRampGen() +{ + val=0; + SetPointsPerPeriod(20); +} - - +void SignedRampGen::SetPointsPerPeriod(float aPoints) +{ + _inc = 2.0/aPoints; +} - - +void SignedRampGen::SetFrequ(float aFrequ) +{ + SetPointsPerPeriod(1.0/aFrequ); +} - - +void SignedRampGen::CalcOneStep() +{ + val = val + _inc; + if( val>1.0 ) + val = -1 + (val - 1.0); +} \ No newline at end of file