The onboard thermometer provides an easy to track the ambient temperature. The MakeCode blocks support Celcius or Fahrenheit degrees.
on temperature hot/cold event allows to trigger code when hot or cold conditions are detected.
temperature block returns the current temperature in Celcius or Fahrenheit degrees.
The example turns the LEDs to red when the temperature goes above 15. It also graphs the current temperature using the LEDs from 0 to 50C.