GPIO Library for BPI-R3

Hello,

as I want to read from a DHT21 sensor, I would like to know if there is a working gpio library for the Banana Pi BPI-R3 like wiringpi or gpio zero for the raspberry pi.

Thanks a lot, best regards David

Sorry, BPI-R3 have no gpio library, But you may directly access the gpio from script or code. the path: /sys/class/gpio/

  1. export GPIO, echo xxx > export
  2. setup the direction output or input: echo out > gpioxxx/direction, echo in > gpioxxx/direction
  3. write or read value : echo xxx > gpioxxx/value, cat gpioxxx/value

Thanks, yes, I already control some device with this method, but now I would like to read a DHT21 sensor and this requires exact timing, which is not possible with the sysfs (shell) method.

Why not use a i2c temperature sensor, for example " MCP9808 High Accuracy I2C Temperature Sensor"

https://www.adafruit.com/product/1782

Or: “AHT20 I2C Industrial Grade Temperature & Humidity Sensor”

https://www.aliexpress.com/i/1005007798524783.html

Already ordered one yesterday, question was because I already had a DHT21 laying around here. But I will go the I2C-route, thanks!