Audio (123) Datatype (17) Demo (65) Development (268) Document (70) Driver (20) Emulation (71) Game (612) Graphics (239) Library (24) Network (79) Office (23) Utility (326) Video (20)
Total files: 1957
Full index file Recent index file
Part of Aros World Exec |
Pisensors | | Description: | DHT11/DHT22 C source library for RPi 3/4 GPIO | | Download: | pisensors_src.aarch64-aros.lha (TIPS: Use the right click menu if your browser takes you back here all the time) | | Size: | 38kb | | Version: | 0.1 | | Date: | 14 Oct 26 | | Author: | Rhun | | Submitter: | Rhun | | Email: | rafal1982/yahoo com | | Requirements: | piAROS (AROS AArch64), Raspberry Pi 3/4 | | Category: | library | | License: | Other | | Distribute: | yes | | FileID: | 3515 | | | | | Comments: | 0 | | Snapshots: | 0 | | Videos: | 0 | | Downloads: | 1 (Current version) | | 1 (Accumulated) | | Votes: | 1 (1/1) (30 days/7 days) | |
[Show comments] [Show snapshots] [Show videos] [Show content] [Replace file] PiSensors is a C source library for reading DHT11 and DHT22 (AM2302)
temperature and humidity sensors on the Raspberry Pi GPIO header under
piAROS (Raspberry Pi 3 / 3B+ / 4).
It is a source / link library, not a system .library: there is nothing
to install. Add the source files to your project, or link the included
libpisensors.a, and read a sensor with a few lines of C:
pig_open();
if (pidht_read(4, 0, &r) == PIG_OK)
printf("%s Cn", pig_tenths_to_str(buf, r.temp10));
DHT11 / DHT22 driver (pidht):
- automatic sensor type detection
- temperature and humidity as integers in tenths (215 = 21.5 C),
no floating point needed
- 2-second guard: the sensor is never read too often
- clear error codes; on a timeout it tells where the reading stopped
(no pull-up, no response, data cut off ...)
- raw data bytes for diagnosis
- the data pin is only ever driven low, never high, and left as input
GPIO layer (pigpio), usable for your own drivers:
- read and set pins with safety checks: only GPIO 2..27 can be
changed, pins used by UART / I2C / SPI are refused unless you pass
PIG_FORCE
- microsecond timer that also works with interrupts disabled
- board detection; Raspberry Pi 5 is refused (GPIO is in the RP1 chip)
Included:
- pigpio.c/h, pidht.c/h the library
- libpisensors.a ready-built link library
- example_dht.c, DHTRead example program for the Shell
- build.sh build script for the AROS cross compiler
- manual.txt API reference, wiring, troubleshooting
- license.txt MIT licence
Planned: DS18B20 (1-Wire), BME280 / BMP280 (I2C).
Connecting sensors is done at your own risk. Read the safety chapter in
manual.txt before wiring anything. GPIO pins are 3.3 V only - never
connect 5 V to a GPIO pin.
Copyright (c) 2026 rhun. MIT licence. Provided "as is", without
warranty of any kind.
|