Introduction - If you have any usage issues, please Google them yourself
C language 8X8 dot matrix scrolling display of temperature, DS18B20 operating procedures
sbit DQ P3 ^ 3
unsigned char time // set the global variable, specifically for strict delay
Function: The sensor DS18B20 initialization, read response signal
Export parameters: flag
bit Init_DS18B20 (void)
{
bit flag // store DS18B20 existence flag, flag 0, indicates the presence flag 1, indicates that there
DQ 1 // first data line HIGH
for (time 0 time <2 time++) // a slight delay of about 6 microseconds
DQ 0 // and then the data line high low, required to maintain 480 ~ 960us
for (time 0 time <200 time++) // a slight delay of about 600 microseconds
// To DS18B20 to emit a continuous 480 ~ 960us of low reset pulse
DQ 1 // release the data line (data line pulled)
for (time 0 time <10 time++)
// Delay about 30us (after the release of the bus to wait for 15 ~ 60us let DS18B20 output pulse exists)
flag DQ // output of the microcontro