I’m working on some code where I have a Time object with a member time. Time.time gives
me the time since my application started in seconds (float value). Now I want to create a pulsating value between 0 and 1 and then from 1 to 0 again, which continues doing thins untill the application stops.
I was thinking to use sin() but don’t know what to pass to it as paramters to create this pulsing value.
How would I create this pulsating value?
Kind regards,
Pollux
You mention using sin(), so I guess you want it to pulse continuously between 0 and 1.
Something like this will do:
1/frequency = 0.1 secondis the period, which is the time between 1’s.