Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which package to use for using GPIOs on Raspberry Pi?

Tags:

go

gpio

How can I read the temperature sensor values on GPIO of a Raspberry Pi using the go language?

Please, anyone help me out.

Thanks in advance.

like image 818
user2725228 Avatar asked Aug 29 '13 00:08

user2725228


People also ask

Which Python library is used for GPIO?

If you code in Python, the RPi. GPIO Python library (included with Raspbian) lets you configure, read, and write to GPIO pins.

How do I enable GPIO on Raspberry Pi?

Configuring Raspberry Pi I2C Firstly, go to the Raspi-Config tool by entering the following command. In here go to Interface Options and then to I2c , enable I2c by selecting Yes . The Pi should now alert you that I2C will be enabled after reboot. It will then ask if you want it to be loaded by default.

Which Python library is used for Raspberry Pi?

In this section, you'll learn how to interact with different physical components using Python on the Raspberry Pi. You'll be using the gpiozero library that comes preinstalled on Raspbian. It provides an easy-to-use interface to interact with a variety of GPIO devices connected to the Raspberry Pi.

Is RPi GPIO installed by default?

GPIO Zero is installed by default in the Raspberry Pi OS desktop image, and the Raspberry Pi Desktop image for PC/Mac, both available from raspberrypi.org.


2 Answers

Check out Dave Cheney's package:

  • https://github.com/davecheney/gpio

There's a classical blink example there.

like image 102
Gustavo Niemeyer Avatar answered Sep 21 '22 15:09

Gustavo Niemeyer


http://embd.kidoman.io/

this is a slightly higher level abstraction than dave cheney's gpio library.

In addition to a gpio api, there is support for many common sensors

not sure what your sensor is, but e.g. here is an example for the bmp180 barometric sensor

like image 21
ben schwartz Avatar answered Sep 17 '22 15:09

ben schwartz