GithubHelp home page GithubHelp logo

helins / linux-gpio.java Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 2.0 171 KB

Use the standard Linux GPIO api from Java

License: Mozilla Public License 2.0

Java 99.28% Shell 0.72%
java jna native linux gpio standard iot

linux-gpio.java's People

Contributors

helins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sdo91 pratiklib16

linux-gpio.java's Issues

event.getId() always returns 0

When I run the push buttons example, event.getId() always returns 0.
Any idea why that might be happening?
I'm running the code on an UP board, Ubuntu 16.04

I changed the device path and line numbers to match my board:

PATH_TO_DEVICE = "/dev/gpiochip4" ;
LINE_NUMBER_BUTTON_1 = 6 ;
LINE_NUMBER_BUTTON_2 = 5 ;

run output:

Starting push buttons...

Come on, press any button and keep pressin' ! Program will terminates after 15000 milliseconds of inactivity.

// when I push the 1st button (expected output: button 1)
1598314100861091495 button 0
1598314101203325508 button 0

// when I push the 2nd button (expected output: button 2)
1598314106373799169 button 0
1598314106500737447 button 0

Timeout, terminating program...

Override Gpio line consumer?

Hi,
I'm using your library to detect button press connected to gpio lines on imx6 board running embedded linux (buildroot). When I call GpioEventHandle requestEvent() to register the handle I'm getting IO exception: java.io.IOException: A requested line is already being used elsewhere
I read in your javadoc that request can be handled by one instance at a time. Is there a way to newly register request handle and overriding consumer which is already using it by setting new one? (FYI I did getconsumer on gpio line and it shows "sysfs")

Thanks

java 8 target

Hello,
I tested your lib with openjdk8. I recompiled all the dependencies and linux-gpio.java. It is working.
Nice job, I can count pulses in user space up to without any errors at 100hz (I didn't test greater frequency).

So, your default target can be java 8, it won't be a problem.
It can help other people that use old jdk for some reasons like me.

(this is really not a big issue)

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.