d2r2 / go-dht

Golang library to interact with DHT11/DHT22/DHT12 temperature and humidity sensors from Raspberry PI.
MIT License
133 stars 52 forks source link

pins could be 4 characters on 64bit RPIs #29

Open thkukuk opened 1 year ago

thkukuk commented 1 year ago

On my Raspberry Pi 3 (64bit kernel and userland) the pins are in the 4 character range (e.g. 2017 for GPIO23) according to kernel debug interface. But the library only uses the first two digits:

bytes_written = snprintf(buffer, BUFFER_MAX, "%d", pin->pin);

Writing manual a 2 digit number in the kernel interface with echo does not work (creates an error), but the "2017" does work. Will fork the code and try to increase the buffer the next days when I have time again.