How to read a 1-wire sensor with C on a Raspberry Pi

D. Hugh Redelmeier hugh-pmF8o41NoarQT0dZR+AlfA at public.gmane.org
Fri Jan 17 17:52:33 UTC 2014


| From: Mel Wilson <mwilson-Ja3L+HSX0kI at public.gmane.org>

|   My DS18B20 project is
| still only prototype code that will be run on an AVR.
| 
| You're working farther up the food chain than I am.

| From: Bill Thanis <qwerty172-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>

| You could open the file descriptor and use the select() call to wait on
| input.

[I have never tried to program an Arduino or other AVR system.  So
don't trust what I say.]

The AVR is a modest embedded processor.  The supplied runtime system
likely doesn't provide pthreads or select calls or file descriptors.
Of course you could build that yourself but it probably isn't the most
direct way to solve problems of this scale.

The Raspberry Pi usually runs Linux and Bill's ideas might apply.  But
I expect most access to the GPIO pins on the RP look more like AVR
than higher-level Unix API.
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list