Skip to content
Display temperature read from Sense Hat on Raspberry Pi
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Sense Temp Letter


Display temperature read from Sense Hat on Raspberry Pi

Goal was to display the temperature using big numbers on Scratch and not just use [say] for a sprite. This means breaking the temperature reading from the Sense Hat down into the individual digits so they can be displayed.

Scratch doesn't have an int() function to let you get a rounding for a digit and mod() only gives the remainder. So, it was necessary when working with numbers to do some interesting combinations of maths to get the individual digits. This is how Sense works

I then noted there is away to get a single character from the variable and tried this as well. It worked. Scratch treats numberical variables like strings when you want to get an individual character from it. This is how Sense Temp Letter works.

For both scripts there is a for the names of the costumes for each digit to make it easy to select the right number character to display.

You can’t perform that action at this time.