User manual
Ausgabe 07.12.2016 Copyright by Joy-IT 15
3
RPi - Explorer700
9. DS18B20 sample programs - Temperature sensor Demos
(Notes: To use the DS18B20 program, you should add a line dtoverlay=w1-gpio-pullup to the end of
the Raspberry Pi boot le /boot/cong.txt, and restart the RPi to make it take eect. For more
detailed informaon, please refer to the relave Raspberry Pi documents.)
sysfs program:
Enter the Linux terminal, and run the following commands to execute the program:
Expected result: The terminal will display the following informaon:
Press the keys Ctrl+C to end the program.
python program:
Enter the Linux terminal, and run the following commands to execute the program:
Expected result: The terminal will display the following informaon:
Press the keys Ctrl+C to end the program.
rom: 28-00000674869d
temp: 30.437 °C
temp: 30.375 °C
pi@raspberrypi ~/Explorer700/DS18B20/fs $ sudo ./ds18b20
rom: 28-00000674869d
C=29.687 F=85.437
C=29.687 F=85.437
C=29.687 F=85.437
pi@raspberrypi ~/Explorer700/DS18B20/python $ sudo python ds18b20.py