The value of the temperature sensor can be read in degrees, either Fahrenheit or Celsius via the INPUT group temperature in block. The example is coded for Fahrenheit. 

Rather than use map for this project, an if..then..else block is used. Lower than 89 degrees, it lights all green. Between 89 and 98 degrees, there is one yellow dot corresponding to the temperature minus 89 degrees. Above 98 degrees, it displays all red.

At a cool room temperature all NeoPixels should be green. Pressing a finger on the sensor should warm it up to a flashing yellow depending on the temperature value. Most likely a finger will not get the sensor above 98 degrees, but taking it out on a hot day will.

Feel free to adjust the values to change the ranges.

This guide was first published on Jul 26, 2018. It was last updated on May 27, 2024.

This page (MakeCode) was last updated on Mar 08, 2024.

Text editor powered by tinymce.