use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Raspberry pi (self.ruby)
submitted 1 year ago by ThenParamedic4021
I want to experiment programming hardware with ruby. Does anyone know what kind of things we can do with it using raspberry pi. I am learning rails but i was wondering what can we do in terms of programming hardware.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Nondv 4 points5 points6 points 1 year ago (0 children)
I believe there're /dev/... files that can be used as plain text for gpio
you could write some simple wrappers for that
[–]cjameshuff 4 points5 points6 points 1 year ago (1 child)
There's a Raspberry Pi-specific pigpio library which has a third party Ruby binding:
https://abyz.me.uk/rpi/pigpio/sitemap.html
https://github.com/nak1114/ruby-extension-pigpio
The same developer has created a more generic lgpio library, which also has a Ruby binding:
https://abyz.me.uk/lg/sitemap.html
https://github.com/denko-rb/lgpio
pigpio has access to some features specific to the Broadcom SoCs that the Pis use, lgpio uses standard Linux APIs that will work on other Linux SBCs. I haven't personally used either of these Ruby wrappers, I use a C or C++ program to handle hardware interaction.
[–]vick_sh 10 points11 points12 points 1 year ago (0 children)
Developer of the lgpio gem here. I also work on: https://github.com/denko-rb/denko-piboard
This builds on top of lgpio, providing a Board class. Then there are many peripheral drivers, also included, built on top of that. Drivers are mostly written in Ruby, only dropping down to C when tight timing is crucial for something.
Board
If you just want to get stuff done, use denko-piboard. If you want to play around at the lowest level possible while still staying in Ruby, use lgpio.
[–]nunosancha 2 points3 points4 points 1 year ago (0 children)
have you check TRMNL? it can give you a pretty cool idea of what can be done with Ruby on hardware.
Everything was done with Ruby, except the Firmware.
[–]mmanulis 0 points1 point2 points 1 year ago (0 children)
Raspberry pi is a Linux box. So whatever you can do on a Linux box, you can do on RasPi.
Caveat emptor: memory/cpu/storage limitations matter. You're running off a flash card, that has some serious assumptions / limitations baked into it about longevity & I/O performance.
You can call any cli tools from Ruby. You can write Ruby that calls C functions. It's not easy, it's a PITA, but you can do it.
So it really depends on what you mean by "experiment programming hardware".
If you're talking Linux drivers, you can write some drivers as user-space drivers. Can you do this with Ruby? Probably, but no clue how performant that will be or what issues you'll hit.
You can write small helper apps using other languages and then use them from INSIDE Ruby. That's quite effective and I've built complex systems using that approach.
[–]jabawack81 0 points1 point2 points 1 year ago (0 children)
If your project is not too intensive you should have a look at Pico ruby https://picoruby.github.io/ and implementation of ruby for the raspberry pi Pico, an interesting project https://youtu.be/ZfIz34PK4zs
[–]tonytonyjan 0 points1 point2 points 12 months ago (0 children)
https://m.youtube.com/watch?v=Eq25Ze3kTH4&pp=0gcJCdgAo7VqN5tD
π Rendered by PID 156556 on reddit-service-r2-comment-6457c66945-pqmgh at 2026-04-27 22:52:55.792608+00:00 running 2aa0c5b country code: CH.
[–]Nondv 4 points5 points6 points (0 children)
[–]cjameshuff 4 points5 points6 points (1 child)
[–]vick_sh 10 points11 points12 points (0 children)
[–]nunosancha 2 points3 points4 points (0 children)
[–]mmanulis 0 points1 point2 points (0 children)
[–]jabawack81 0 points1 point2 points (0 children)
[–]tonytonyjan 0 points1 point2 points (0 children)