← Getting Started ← Home

Why an emulator?

Not everyone learning Pi4J has a Raspberry Pi and a Sense HAT sitting next to their keyboard. The sensehat-emulator is a software stand-in for the physical board: your code calls the same SenseHat API, but the LED matrix, joystick and sensors are rendered and simulated on your development machine.

What you get

  • A visual 8×8 LED matrix that mirrors setPixel, setPixels, fill, showLetter and showMessage calls.
  • A simulated joystick — mapped to the keyboard so you can trigger up/down/left/right/center events.
  • Fake sensor readings for temperature, humidity, pressure and the IMU, so code paths that read sensors don't crash off-Pi.

How it fits with the playground

The emulator implements the same SenseHat surface used by every example on this site. That means most of the projects here can be run against the emulator with only a swap of the runtime — useful for:

  • Trying an example before you buy the hardware.
  • Teaching a classroom where only one Pi is available.
  • Iterating on drawing code without redeploying to the Pi every save.
  • CI runs and smoke tests where a real board isn't available.

Links