thisdavej / ds18b20-raspi

Get temperature readings from a DS18B20 1-Wire sensor connected to a Raspberry Pi
MIT License
17 stars 4 forks source link

connection GPIO 4 Raspi #8

Closed felipeguerrero87 closed 4 years ago

felipeguerrero87 commented 4 years ago

only serves in GPIO 4?

thisdavej commented 4 years ago

According to this answer, you can add an entry to /boot/cmdline.txt to specify a different GPIO pin other than pin 4 for the 1-wire interface (used by the DS18B20) as follows:

bcm2708.w1_gpio_pin=8

My npm package will continue to function since it reads from the sysfs file system used by the 1-wire interface and the same files will exist whether the default GPIO pin 4 is used or this technique is used to change the default 1-wire GPIO pin.