Joy-it KY-001 Скачать руководство пользователя страница 5

 

Published: 27.08.2018  

Copyright by Joy-IT 

 

Temperature Sensor 

In order for the Raspberry Pi to be able to communicate with the One

-

Wire Bus, with which the DS18B20 

sensor transmits its measurement data digitally, it must first be activated. The file "

/boot/config.txt

" must 

be edited. To do this, open a terminal window and enter the following command to open the file:

 

 

Now add the following line to the opened file at the end:

 

Save the file with the key combination 

CTRL+O 

and exit it with the combination 

CTRL+X

.

 

Now restart your Raspberry Pi with the following command so that the changes you have made take 
effect:

 

You can download the code example for Raspberry Pis 

here 

or copy and paste the following sections.

 

 

 

4.  CODE EXAMPLE RASPBERRY PI 

sudo nano /boot/config.txt

 

dtoverlay=w1

-

gpio,gpiopin=4

 

sudo reboot

 

Содержание KY-001

Страница 1: ...3 Temperature Sensor KY 001...

Страница 2: ...ished 27 08 2018 Copyright by Joy IT 2 Temperature Sensor 1 Overview 2 Pin Assignment 3 Code Example Arduino 4 Code Example Raspberry Pi 5 Information and take back obligations 6 Support TABLE OF CONT...

Страница 3: ...ing and use Should you encounter any unexpected problems during use please do not hesitate to contact us 1 OVERVIEW Chipset DS18B20 Communication protocoll 1 Wire Accuracy of Measurement 9 12 Bit Rang...

Страница 4: ...Arduinos here or copy the following one 3 CODE EXAMPLE ARDUINO Required libraries are imported include DallasTemperature h include OneWire h The input pin to which the sensor module is connected is d...

Страница 5: ...minal window and enter the following command to open the file Now add the following line to the opened file at the end Save the file with the key combination CTRL O and exit it with the combination CT...

Страница 6: ...lished print Warte auf Initialisierung base_dir sys bus w1 devices while True try device_folder glob glob base_dir 28 0 break except IndexError sleep 0 5 continue device_file device_folder w1_slave Fu...

Страница 7: ...lines 1 find t if equals_pos 1 temp_string lines 1 equals_pos 2 temp_c float temp_string 1000 0 return temp_c main loop The measured temperature is sent to the console between the individual measureme...

Страница 8: ...om us free of charge when purchasing a new device Small appliances where no external dimensions are larger than 25 cm can be delivered in normal household quantities irrespective of the purchase of a...

Страница 9: ...re any questions left or if you encounter any problems please feel free to contact us by mail phone or by our ticket system on our website E Mail service joy it net Ticket System http support joy it n...

Отзывы: