Hey all, I'm using an ESP32 as my temperature sensor module and my task is to generate an alert continuously if the temperature is higher than 30°C. Alert is cancelled only when the temperature drops below 29°C. generate an alarm continuously if the temperature is higher than 32°C. Alarm is cancelled only when the temperature drops below 31°C.
this is my timer block. when i code it like this it shows Error 703: Unable to play sound. It is a problem with the placing of the blocks because the sound was able to be played previously when I just used a simple if else loop. (I edited the codes as it didn't fulfill my code fully as the task wanted)
You never assigned a sound file to any of your sound components:
Also, your temperature range comparisons are all mixed up (they should be one if/then/elseif ladder in ascending or descending order), and you destroy the variable contents (temperature) right before testing them.
As advised earlier, switch those Sound components for a Player component preloaded with the alarm sound, and use this block to test if it is playing already, instead of keeping a flag variable: