<< Reactive Spring Flux data from a Pi
Creating a timeline image with JavaFX >>

Controlling a LED number display with JavaFX and Python on Raspberry Pi

2019-12-18 07:31:44
This is an example application from my book Getting started with Java on the Raspberry Pi.
There is a lot more info about this topic and other code examples in the book!
You can buy it on Leanpub and will receive all future updates!

Complete detailed description covers 17 pages in the book... :-)
In my book I explain the use of bits and bytes by using a shift register SN74HC595 IC and 5101AS LED number display.

Defining the bytes for each number

In the table below the bits are defined to get the hex/number value needed to light up the required segments (A - H) of the LED segment display:

JavaFX application

Here a little movie with the end result, sorry for the shaky breadboard recording, I should have used a tripod ;-)

The sources are available on GitHub to build and run this application which uses the LEDNumberDisplay Maven dependency I wrote about before:

Also included in the sources is a Python script which is copied to the tmp-directory on the Pi and then gets called whenever the selected bits change in the JavaFX application.


To setup the experiment you'll need a lot of wires and a breadboard. The end result will look like this:

To make things more clear the same setup in a wiring diagram:


It's a really fun experiment to go through this process of setting up the components on the breadboard, writing the Python script and building a JavaFX application on top of that.

Full info is part of "Chapter 8: Bits and bytes" in "Getting started with Java on the Raspberry Pi".