⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cornometersies.bas

📁 this is a cornometer that i write it by bascome compiler for MicroController ( AVR-mega32)
💻 BAS
字号:
$regfile = "m32def.dat"
$crystal = 2000000
Dim Second As Byte , Minute As Byte , Ss As Integer , X As Bit , Tog As Bit , Ms As Byte
Config Porta = Input
Config Portc = Output
Config Timer0 = Timer , Prescale = 8
Stop Timer0
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Portb.2 , Rs = Portb.0
Waitms 200
Cls
Enable Interrupts
Enable Timer0
On Timer0 Seconds
X = 0
Tog = 0
Start Timer0

Do
If Porta.1 = 1 Then
   If X = 0 Then
        If Tog = 0 Then
         Start Timer0
      Else
           Timer0 = 0
         Stop Timer0
      End If
     X = 1
   End If
End If


If Ss > 99 Then
   Ss = 0
   'Toggle Portc.1
   Incr Second
End If
If Second > 59 Then
   Second = 0
   Incr Minute
End If
Locate 1 , 2
Cursor Off
Lcd Minute ; ":"
Locate 1 , 4
Lcd Second ; ":"
Locate 1 , 7
Lcd Ss
Loop

Seconds:
Incr Ms
If Ms >= 10 Then
   Ms = 0
   Incr Ss
End If
'Toggle Portc.0
Return
Return

End

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -