tech-embed archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ds18b20 Temperature Sensor



Has anyone had success using a ds18b20 temperature sensor in NetBSD?

I am trying to find the simplest way to read a ds18b20 temperature sensor.

I am using NetBSD 9.2 on Raspberry Pi Zero W.

I connected the sensor supply to 3.3V supply, ground to ground, and
data to GPIO4,

I set gpio=yes in /etc/rc.conf.

Here is what I have tried in my /etc/gpio.conf.
#gpio0 4 set inout #does not work
#gpio0 4 set in #works
#gpio0 4 set out #works
#gpio0 4 set inout #does not work
#gpio0 4 set gpioow # does not work
#gpio0 attach gpioow 4 0x01 #does not work

I think to have "userland" (I think this is the correct term) access
to the temperature sensor, I need "inout" since it is a bidirectional
interface. But this configuration does not seem to work based on
running "gpioctl gpio0" after boot.

I think I am missing a step somewhere.

Any suggestions?

Thanks in advance!


Home | Main Index | Thread Index | Old Index