threshold and alarm trigger Copy(updated code) - Wokwi ESP32, STM32, Arduino Simulator