Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAQ? #1

Open
rubyFeedback opened this issue Oct 12, 2024 · 2 comments
Open

FAQ? #1

rubyFeedback opened this issue Oct 12, 2024 · 2 comments

Comments

@rubyFeedback
Copy link

Do you think a FAQ could be added to the project?

One question I have is whether there is a possibility for a GUI in regards to lgpio. Perhaps something like libui-ng, although that one focuses on gtk3 so it may be too much for small devices.

@vickash
Copy link
Contributor

vickash commented Oct 13, 2024

A Frequently Asked Questions section is a good idea, but this is literally the first question, so maybe in future?

Wrt a GUI, the purpose of this gem is to be the absolute minimum to make Linux GPIO accessible in Ruby. Nothing more. It won't ever do GUI anything. Also, to be clear, this is for Linux SBCs in the same class as the Raspberry Pi 1 or above, not anything smaller.

That said, if you want a GUI in a Ruby program, you can use the ruby2d gem for your GUI, together with lgpio for your GPIO access.

I would recommend you check out denko-piboard instead of lgpio though. It uses lgpio under the hood, but has more (opinionated) layers built on top: abstract away gpiochip/line, pwmchip/channel, soft/hard PWM, buses etc. Also, all the device driver work goes into the main denko gem, which makes them available in denko-piboard too, but not lgpio.

I didn't put the lgpio stuff directly in denko-piboard for a couple reasons:

  • Eventually, some of the things denko-piboard uses lgpio for, may be done by another gem
  • No one is forced into the (non-zero-cost) abstractions I choose for the denko gems, but they can still leverage the work done for lgpio

@vickash
Copy link
Contributor

vickash commented Oct 13, 2024

@rubyFeedback, take a look at this example.

I've been meaning to try ruby2d for a while. It seems very straightforward to use. I imagine it's possible to run on a Raspberry Pi touchscreen or something similar. I haven't experimented with that yet, but would be fun to try out. Will add more examples if and when I do.

Also, the libui-ng library you mentioned is supported by the Glimmer DSL: https://github.com/AndyObtiva/glimmer-dsl-libui. You should be able to use that in combination with one of the denko gems, just as I've done with ruby2d in the above example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants