bbx10 / htu21dflib

htu21df temperature and humidity sensor support for Raspberry Pi
MIT License
15 stars 2 forks source link

Raspberry Pi Version 1 Support #1

Closed mccada closed 9 years ago

mccada commented 9 years ago

In the htu21dflib.c file there is a line that is hard coded to the Raspbery V2 i2c value.

static const char I2CDEV[] = "/dev/i2c-1"; // raspberry pi

The version 1 Pi uses the i2c-0 address for the bus. You could maybe add a check for what version it is running on, and set the value accordingly.

Otherwise great code that works well!

bbx10 commented 9 years ago

The library now has code to auto select the raspi i2c device based on the board revision. I hope it works on the rev 1 Pi. If the board is not a Pi, it defaults to i2c-0.

mccada commented 9 years ago

Works for my revision 1 board. Nice work, thank you.