ev3dev / ev3dev-lang

(deprecated) language bindings for ev3dev sensors, motors, LEDs, etc.
GNU General Public License v2.0
56 stars 39 forks source link

pb with buttons #2

Closed cho934 closed 10 years ago

cho934 commented 10 years ago

Hello,

I've just tested this test, and it seems all buttons are always UP when I display the value. Can you try if you have the same problem ?

Best regards, Christophe

fdetro commented 10 years ago

The button classes use the old sysfs devices, which were removed in recent ev3dev test releases.

Buttons are now implemented in the kernel as standard linux input devices. An example how to access these can be found in drive-test.cpp in the function control::terminate_on_key().

cho934 commented 10 years ago

I don't understand how "/dev/input/by-path/platform-gpio-keys.0-event" works exactly to detect each button. Have you got another explanation or a patch to modify the ev3dev-lang-demo.cpp / ev3dev.cpp?

fdetro commented 10 years ago

Please take a look at this conversation, where @dlech explains the new approach: https://github.com/mindboards/ev3dev-kernel/issues/24. With this new approach my button classes do not work any longer, I need to change the concept. As soon as we have the next stable kernel release with a stable API, I will fix the button code.

cho934 commented 10 years ago

Thanks a lot. Using the C code from @dlech, I modified the button class and I added 3 private properties. I modified also the pressed() function. So it works ! The command "close(fd);" is not yet implemented , maybe I can add it in the class destructor function... Where can I send you the update ? by email ? using a new comment ?

fdetro commented 10 years ago

Simply create a branch in your local git repo, commit your changes and push the branch to GitHub. Then create a pull request on this branch, this enables me to review your changes and add them to my repo.

cho934 commented 10 years ago

Sorry for the delay. The new code is now on my github and I created the pull request. https://github.com/cho934/ev3dev-lang

fdetro commented 10 years ago

No problem with the delay. Thank you for your input.

cho934 commented 10 years ago

All your requests are done.

Christophe.

2014-08-24 12:06 GMT+02:00 Franz Detro notifications@github.com:

No problem with the delay. Thank you for your input.

— Reply to this email directly or view it on GitHub https://github.com/fdetro/ev3dev-lang/issues/2#issuecomment-53186606.