RTTTL Repeat
Moderators: grovkillen, Stuntteam, TD-er
Re: RTTTL Repeat
Assuming you already send an event to play the rtttl sequence, you can set a timer (or a looptimer, only need to set it once), that timer is then to be reset to 0 once MQTT sends an event to stop the sound.
/Ton (PayPal.me)
Re: RTTTL Repeat
Possible solution (Rules and Old engine must be enabled on Tools/Advanced page)
Code: Select all
on StartAlarm do
rtttl,... // whatever sequence you want
if %v1%=0
TimerSet,1,5 // Repeat after 5 seconds silence
else
Let,1,0 // re-arm for next MQTT StartAlarm
endif
endon
on System#Timer=1 do
AsyncEvent,StartAlarm // Add to event queue
endon
on StopAlarm do
Let,1,1 // Stop repeat, current rtttl sequence will continue until completed
endon
/Ton (PayPal.me)
Re: RTTTL Repeat
Playing RTTTL is blocking code.
So it is better to set various PWM values based on a loop timer.
See looptimer_ms: https://espeasy.readthedocs.io/en/lates ... =looptimer
The PWM pulsing will continue after you set it, until you change it.
So in the loop timer you can toggle between values like @Ath showed in his example and based on the toggling of a value you can set a new frequency.
So it is better to set various PWM values based on a loop timer.
See looptimer_ms: https://espeasy.readthedocs.io/en/lates ... =looptimer
The PWM pulsing will continue after you set it, until you change it.
So in the loop timer you can toggle between values like @Ath showed in his example and based on the toggling of a value you can set a new frequency.
Who is online
Users browsing this forum: No registered users and 68 guests