$regfile = "m16def.dat"
$crystal = 8000000
Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.2 , Rs = Portc.0
Config Lcd = 16 * 2
Config 1wire = Porta.0
'*************************************************
Dim Id(8) As Byte
Dim I As Byte
Dim C(2) As Byte
Dim T As Word
'*************************************************
Deflcdchar 0 , 14 , 10 , 14 , 32 , 32 , 32 , 32 , 32 ' 定义度的显示字符
Deflcdchar 1 , 4 , 10 , 17 , 4 , 31 , 2 , 4 , 8 '定义汉字今的显示字符
Deflcdchar 2 , 31 , 4 , 31 , 4 , 12 , 10 , 18 , 17 '定义汉字天的显示字符
'***************************************************
Dim Shi As Byte , Fen As Byte , Miao As Byte
Dim S As String * 2 , F As String * 2 , M As String * 2
Dim N_shi As Byte , N_fen As Byte , Zt As Bit
Dim N_s As String * 2 , N_f As String * 2
Dim Key_in As Byte
Dim Beep_times As Byte
Config Portb = Input
Portb = &HFF
Initlcd
Cls
Shi = 12
Fen = 0
Miao = 0
N_shi = 12
N_fen = 0
Zt = 0
Cursor Off
Main:
Cls
Gosub Disp
Gosub Ds18b20csh
Gosub 18b20js
Gosub Key_scan
Gosub Naoshi
Gosub Jishi
Goto Main
End
............
............
..............
程序是正确的,实验是成功的,温度是能显示的,时间是很准确的
小问题也是存在的,基本上也是能解决的.凑合凑合也是能用的
设计资源 培训 开发板 精华推荐
- 开源USB2.0高速分析仪
- ADR364B 4.096V 低功耗、低噪声电压基准的典型应用,具有灌电流/拉电流能力
- Sg1525A稳压脉宽调制器典型应用电路
- LTC2992HDE 四象限功率监视器的典型应用(10kHz I2C 接口)
- CY8C4127LQI-BL453 4100_BLE PSoC 可编程片上系统的典型应用
- NCP45760IMNGEVB:NCP45760IMN24RTWG 评估套件
- 使用 Silicon Labs 的 C8051F012 的参考设计
- AD8604ARUZ-REEL放大器光电二极管电路典型应用
- AD8625ARZ-REEL7单极输出精密放大器典型应用电路
- 使用MC33772C实现ETPL通信的800V电池接线盒