{"repo":"ClockVapor/rpi_gpio","free":true,"listed":false,"github":"https://github.com/ClockVapor/rpi_gpio","clone":"git clone https://github.com/ClockVapor/rpi_gpio.git","description":"Ruby conversion of RPi.GPIO Python module","language":"C","stars":221,"topics":["raspberry-pi","raspberrypi","raspberry-pi-3","gpio","gpio-pins","pwm","ruby","raspberry-pi-4","rpi","rpi-gpio"],"license":"MIT","category":"self-hosted-apps","readme_excerpt":"rpi gpio v0.7.1 Ruby conversion of RPi.GPIO Python module Features Manipulate your Raspberry Pi's GPIO pins from Ruby! - Boolean input/output - Software-driven PWM (written in C for speed) - Event-driven input (blocking and non-blocking) Up-to-date with RPi.GPIO Python module version 0.7.1, so it works on all Raspberry Pi models! Sample Usage I aimed to make the gem's usage exactly the same as its Python counterpart -- only with a few semantic differences to utilize Ruby's readability. If anything is confusing, you can always check here for the original Python module's documentation. Download the gem The easiest way to download the gem is to use Bundler with a Gemfile. In your Gemfile, include the line Then you can run bundle install to automatically download and compile the gem for your system. To include the gem in a Ruby file, use the line require 'rpi gpio' . Pin numbering Before you can do anything with the GPIO pins, you need to specify how you want to number them. :board numbering refers to the physical pin numbers on the Pi, whereas :bcm numbering refers to the Broadcom SOC channel numbering. Note that :bcm numbering differs between Pi models, while :board numbering does not. Input To receive input from a GPIO pin, you must first initialize it as an input pin: The pin number will differ based on your selected numbering system and which pin you want to use. You can use the additional hash argument :pull to apply a pull-up or pull-down resistor to the input pin like so:","default_branch":null,"files":null,"tree":[],"storefront":"/r/ClockVapor","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ClockVapor/rpi_gpio/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}