标题: 能显示温度及时间(能调时闹时)的bascom-avr程序 [打印本页]

作者: 243412038    时间: 2020-9-16 10:32
标题: 能显示温度及时间(能调时闹时)的bascom-avr程序
$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
............
............
..............
程序是正确的,实验是成功的,温度是能显示的,时间是很准确的
小问题也是存在的,基本上也是能解决的.凑合凑合也是能用的

bascom-m16-18b20.zip

1.65 KB, 下载次数: 9, 下载积分: 黑币 -5

能显示温度及时间(能调时闹时)的bascom-avr程序






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1