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

Share on facebook
Share on twitter
Share on linkedin

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 šŸ˜‰

Wiring

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:

Conclusion

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ā€.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1 other subscriber

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

Follow Me

My Latest Posts

Hacker Stars

Questions?

Sign up for our Newsletter

Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit