This repo contains a collection of Python and C samples to demonstrate using various hardware GPIO sensors with Raspberry Pi on QNX 8.0. Please feel free to contribute new samples or to tweak existing samples!
All of the sample applications and APIs collected in this repository have been tested on Raspberry Pi 4B running the QNX 8.0 quick start target image. Recent updates should also enable these samples to run on Raspberry Pi 5 QNX 8.0 quick start target image as well.
Any modifications to the standard configuration required for any sample code to run will be noted in those sections.
| IC/Module | Type | Interface(s) | Used In Sample(s) | Languages |
|---|---|---|---|---|
| 1602 LCD | Character Display | I2C | LCD 1602 Display | C, Python |
| 4‑digit 7‑segment | Numeric Display | GPIO | 4‑Digit 7‑Segment Display | C, Python |
| 7‑segment LED | Single Digit Display | GPIO | 7‑Segment Display | C, Python |
| BH1750 | Light Sensor | I2C | Light Sensor BH1750 | C |
| BNO055 (Adafruit) | 9‑DoF IMU | I2C | Adafruit IMU BNO055 | C, Python |
| DRV8833 | Motor Controller | PWM, GPIO | Motor Controller | C, Python |
| HC‑SR04 | Ultrasonic Distance Sensor | GPIO | HC‑SR04 Ultrasonic | C, Python |
| HC‑SR501 | PIR Motion Sensor | GPIO | PIR Motion Sensor | C, Python |
| ICM‑20948 (SparkFun) | 9‑DoF IMU | I2C | ICM‑20948 IMU | C, Python |
| KY‑023 | Analog Joystick | Analog | Analog Joystick, Joystick Matrix Game | C |
| LED | Light Emitting Diode | GPIO | LED Blink, LED Button | C, Python |
| LED (RGB) | Multi-color Light | GPIO | LED RGB 4‑Wire | C, Python |
| MAX7219 | LED Matrix Driver | SPI | LED Matrix 8x8, Joystick Matrix Game | C |
| Matrix Keypad | 4x4 Numeric Input | GPIO | Keypad Numeric | C, Python |
| MCP3008 | Analog-to-Digital Converter | SPI | Analog Joystick, Joystick Matrix Game | C |
| PCF8574 | I/O Expander | I2C | LCD 1602 Display | C, Python |
| PCF8591 | ADC/DAC Converter | I2C | PCF8591 10k Pot, PCF8591 Pot → LED, PCF8591 GG Board | C, Python |
| PCF8591 GG Board | Multi-sensor Development Board | I2C | PCF8591 GG Board | C, Python |
| Pushbutton | Digital Input Switch | GPIO | LED Button, Rotary Encoder | C, Python |
| Rotary Encoder | Position/Rotation Sensor | GPIO | Rotary Encoder | C, Python |
| SG90 | Micro Servo Motor | PWM | Servo | C, Python |
| SHT3X | Temperature & Humidity Sensor | I2C | Temperature Humidity | C |
| SN3218A | 18‑channel LED Driver | I2C | SN3218A RGB LED | C, Python |
| WS281x | Addressable RGB LED | SPI | LED Strip Matrix | C |
This section of the repository contains useful system headers as well as client APIs that will be helpful to interact with hardware components.
Get a free, non-commercial QNX Software Development Platform 8.0 license at https://www.qnx.com/getqnx.
These sample projects are designed to be used alongside the following repositories:
Provides a ready-to-use QNX image for Raspberry Pi.
https://gitlab.com/qnx/quick-start-images/raspberry-pi-qnx-8.0-quick-start-image
A customizable build system for creating your own QNX 8.0 image.
https://gitlab.com/qnx/custom-target-image-builds/repo
Note that the QSTI image and CTI projects now builds an image with the QNX Developer Desktop. You can clone this repo with this environment and build these sample apps on a RaspBerry Pi 4 or Raspberry Pi 5 directly now!
Feel free to submit changes or updates to this repo to resolve issues or improve features.