I've been thinking about this for a bit.
If I create a timer, then divide the timer preset by 2, and then subtract 1/2 the timer preset from the timer .ACC, then take the absolute value, I get a number that counts from 1/2 the preset down to 0 and then back up to the preset.
ABS(Timer.ACC-(Timer.PRE/2))
For example, if I have a 2000 millisecond timer, the number I get goes from 1000 down to 0 and then back up to 1000.
I can plug that into an SCP block with my scaled min and scaled max inverted, or I can use a line function in a CPT (compute) statement.
Using the line function y=mx+b:
- x = 1000 when timer.acc is 0.
- x = 0 when timer.acc is 1000
- x = 1000 when timer.acc is 2000 (timer.acc = timer.pre)
- I want to ramp from 0 to 100% and back down, so...
- my m term will be (-100/1000) and my b will be 100.
Reset the timer when it times out and you'll have a continuous triangle wave generator that ramps 0 to 100% in one second, then back down in one second, lather, rinse, repeat.
Since this uses floats it might be beyond what your instructor is looking for, you may want to just use two timers, one to ramp up and one to ramp down. The ramp down timer is started by the end of the ramp up timer. When the ramp down timer completes it resets the ramp up timer. Then use the .acc of whichever timer applies in a line equation or an SCP block.