Rpi-hw library

Rpi-hw (short for “Raspberry Pi Hardware”) is a free C++ library
designed to manage the Raspberry Pi’s GPIO connector and its other buses.

Ultrasonic Distance Sensor PCD8544 LCD

It allows you to connect several devices to the board (including displays, keypads, stepper motors, and sensors) as you would with Arduino’s libraries.

The latest sources of Rpi-hw are available on github.com at:


  • Low-level access to the GPIO Connector and SPI, I2C, UART buses
  • High-level input/output interfaces
  • Support for I/O expander ICs
  • Support for many devices, including displays, keypads, stepper motors, and sensors (see “List of supported devices” section)
  • Unicode support (built-in)
  • Support for standard fonts (using FreeType) (optional)
  • Support for multiple image formats (using Magick++ API) (optional)
  • Drawing functions

List of supported devices

  • 8-bit I/O expander with I2C/SPI (MCP23008, MCP23S08)
  • 16-bit I/O expander with I2C/SPI (MCP23017, MCP23S17)
  • Character LCDs (Hitachi HD44780) - example
  • Graphical LCDs (Philips PCD8544) - example
  • Single and multiple 7-segments diplays - example
  • Matrix keypads - example
  • Ultrasonic distance sensor (HC-SR04)
  • Stepper motors

To-do list

  • Support for UART interface


Detailed documentation of Rpi-hw’s features and usage can be found on the official wiki.

Also you can find some articles about the library on http://hackyourmind.org/.


The library is released under terms of the GNU LGPL v3.

Bug tracker

Have a bug? Please create an issue on GitHub at https://github.com/Wicker25/Rpi-hw/issues.

Did you find this page helpful?


  1. when i compling Rpi-hw, i get error like this:

    cclplus: error: unrecognized command line option 'std=c++11'
    make[2] *** [CMakeFiles/rpihw.dir/src/utils.cpp.o] Error 1
    make[1] *** [CMakeFiles/rpihw.dir/src/all] Error 2
    make: *** [all] error 2
    irvan on Tue, 5 Aug 2014 @ 3:02 am user image
  2. Hi irvan,

    you need to to install g++-4.7 before compiling the library.

    For more information see the documentation.


    admin on Tue, 5 Aug 2014 @ 9:08 pm user image