“Desktop Sense HAT emulator” is an emulator used in Raspbian. In addition to Desktop Sense HAT emulator published on official Raspberry Pi blog, a dedicated document page is also released:
Installation – Sense-Emu 1.0 documentation
It’s easy to install with “apt-get” command. After executing the usual “update” command, install the following packages.
sudo apt-get update
sudo apt-get install python-sense-emu python3-sense-emu python-sense-emu-doc sense-emu-tools -y
Once the installation is complete, you can use it immediately without rebooting.
When I look at the desktop menu…
“Sense HAT Emulator” has been added under “Programing”!
Please note that this is not compatible with external operations such as remote desktop connection.
Here is the initial screen (Figure 4). The big difference from the web-based emulator is that you can manually set the “Yaw,” “Pitch,” and “Roll”?
Buttons for the joystick are also provided on the desktop emulator.
Click the arrow button at the bottom to turn over the Raspberry Pi. The direction of “Yaw,” “Pitch,” and “Roll” is indicated on the screen, which makes it easy to visualize.
Now, let’s test some sample programs!
Select [File] → [Open example] → [Simple] → [humidity.py] from the menu on the upper right.
IDLE 3 is started and the sample code is displayed!
Let’s run the program from [Run] → [Run Module] on the menu bar by pressing the [F5] key on the keyboard.
If you move the “Humidity” bar up and down, the green area of the LED matrix increases or decreases, respectively.
It’s difficult to set the value(s) acquired by the sensor such as temperature, humidity, and atmospheric pressure to an arbitrary value in an actual environment, so this emulator comes in pretty handy.
It’s also great not only for programming but also for debugging stuff.