Skip to content

tomxue/Pi___LED-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java-Shell___LED-control
========================

to control LED on Raspberry by Java, which will invoke a shell code (apply wiringPi)

Some example code is from link: http://www.oschina.net/question/1425530_140979

========================
For java code to invoke shell:

Precondition:
    install wiringPi on Raspberry

Compile:
    javac test.java

Run:
    java test

========================
For file button.c:

    Compile:
        cc -o button button.c -lwiringPi
========================
For final solution, go into the directory: final:
    Compile:
        gcc -lwiringPi -o gpio-interrupt gpio-interrupt.c
    Run:
        ./gpio-interrupt

    Java code:
        javac ThreadTester.java
	// Due to reboot will be invoked, so we must use "root" account
	sudo su
        java ThreadTester

About

to detect the button press and light up the led on my Raspberry Pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published