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

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

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.

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


To setup the experiment you’ll need a lot of wires and a breadboard. The end result will look like the image below. To make things more clear, also a drawing with 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”.

Picture of Frank Delporte

Frank Delporte

Author of Getting Started with Java on Raspberry Pi" which is for sale on Leanpub (ebook) and Elektor (paper book). Software developer/technical lead/writer with more than 20 years of experience in video, multimedia, technical project management, digital signage, and (web) programming. Since 2010 I work for Televic Rail in Izegem, Belgium. My current work tools are Java/Git/Atlassian/IntelliJ IDEA/Visual Studio Code, but also use/used ASP.NET, C#, JavaScript, Angular, SQL Server, Flex, CSS, HTML5, Eclipse, QT,… I love to KISS (Keep It Simple, Stupid) and try to do this in everything I do.

Leave a Replay

Leave a Reply

Your email address will not be published. Required fields are marked *

Follow Me

More Posts By Frank