Giter VIP home page Giter VIP logo

rpi_led_blink_java's Introduction

Raspberry Pi LED Blink Project (Java)

Installation

Dependencies Install JRE/JDK

If you have not already installed a Java runtime environment, please see the following article for a complete set of installation instructions for installing the Oracle JDK.

WiringPi Native Library

Pi4J depends on the WiringPi native library by Gordon Henderson. Please see the following page for more information on WiringPi. https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/

No installation is required for Wiring Pi. Wiring Pi is embedded in the Pi4J native library.

Pi4J

Install Pi4J

Download a copy of the latest Pi4J Debian/Raspian installer package (.deb) file. You can use the following command on the Raspberry Pi's console to download the latest pi4j.jar build: wget http://pi4j.googlecode.com/files/pi4j-0.0.5.deb

NOTE: If you have a previous version of Pi4J installed, please uninstall it first.

Once downloaded, use the following command to perform the installation:

sudo dpkg -i pi4j-0.0.5.deb

This will install the Pi4J libraries and example source files to:

/opt/pi4j/lib /opt/pi4j/examples

When attempting to compile a Java program using the Pi4J libraries, make sure to include the Pi4J lib folder in the classpath:

javac -classpath .:classes:/opt/pi4j/lib/'*' ...

When attempting to start a Java program using the Pi4J libraries, make sure to include the Pi4J lib folder in the classpath:

sudo java -classpath .:classes:/opt/pi4j/lib/'*' ...

If you would like to explore the examples, you can compile all the examples with the following commands:

cd /opt/pi4j/examples ./build Uninstall Pi4J

To uninstall Pi4J from your Raspberry Pi, use the following command:

sudo dpkg -r pi4j

Pin Numbering

Pin Numbering

Wiring Diagram

Wiring Diagram

Navigate

If you have not already downloaded and installed the Pi4J library on the RaspberryPi, then view this page for instructions on where to download and how to install Pi4J:

Download & Install Pi4J

First, locate the GPIO_Control.java source file in the samples folder of the Pi4J installation on the RaspberryPi.

You can use the following command on the Pi's console or SSH terminal to navigate to this path:

cd /opt/pi4j/examples

Compile

Next, use the following command to compile this example program:

javac -classpath .:classes:/opt/pi4j/lib/'*' -d . GPIO_Control.java

Execute

The following command will run this example program:

sudo java -classpath .:classes:/opt/pi4j/lib/'*' GPIO_Control

İsmet Said Çalık WebSite

rpi_led_blink_java's People

Contributors

icalik avatar

Watchers

James Cloos avatar İsmet Said Çalık avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.