第一部分
硬件电路图
电容的作用:
https://blog.csdn.net/flying_man_/article/details/82557816
上拉电阻的作用:
跳线帽连接:
程序部分
float temp_f; //浮点型LCD显示
u8 temp_i; //数码管整数型显示
ds18b20_init_x();
while(1)
{
temp_f = ds18b20_read() * 0.0625; //默认精度为12位
temp_i = temp_f; //将浮点型转换为整型
sprintf((char*)str, " Temperatrue:%2.2f ", temp_f);
LCD_DisplayStringLine(Line8,str);
SEG_DisplayValue(temp_i/10, temp_i%10,12);//温度十位,个位,字符C
}