Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Java FX 8 Essentials

You're reading from   Java FX 8 Essentials Create amazing Java GUI applications with this hands-on, fast-paced guide

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781784398026
Length 224 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

The switch application


The switch application is very simple in its nature, but the idea is mainly divided into two main points: how to run JavaFX 8 applications on Raspberry Pi and how to control the outside world from the Raspberry Pi General-purpose input/output (GPIO). We will use a project called Pi4j for such purpose.

The idea is simple; we are going to create a JavaFX application that will act as a switch controller to control a LED associated to an electrical circuit connected to your Raspberry Pi.

The following screenshots show the application in the ON and OFF states:

Switch Application ON state

.

Switch Application OFF state

What is the Pi4J library?

The Pi4j library (http://pi4j.com) is a project intended to provide a bridge between the native libraries and Java for full access to the Raspberry Pi features and controls, so you can easily access the GPIO pins for your Java project.

Visit http://pi4j.com/pins/model-2b-rev1.html for Raspberry Pi 2 model B (J8 header) for GPIO pin numbering...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image