| | |
| | | * Version: 1.0.0(2018/10/14) |
| | | * Author: Guo Wenxue <guowenxue@gmail.com> |
| | | * ChangeLog: 1, Release initial version on "2018/10/14 12:13:26" |
| | | * |
| | | * |
| | | * |
| | | * Pin connection: |
| | | * |
| | | * vcc --- #Pin1 ( 3.3v ) |
| | | * DQ --- #Pin7 (BCM GPIO4) |
| | | * GND --- #Pin9 ( GND ) |
| | | * |
| | | * /boot/config.txt: |
| | | * |
| | | * dtoverlay=w1-gpio-pullup,gpiopin=4 |
| | | * |
| | | ********************************************************************************/ |
| | | |
| | | |
| | | #include <stdio.h> |
| | | #include <stdlib.h> |
| | |
| | | return 1; |
| | | } |
| | | |
| | | printf("DS19B20 get temperature: %f ℃\n", temp); |
| | | printf("DS18B20 get temperature: %f ℃\n", temp); |
| | | return 0; |
| | | } |
| | | |