کد:
$regfile = "m16def.dat"
$crystal = 8000000
$baud = 9600
'~~~~~~~~~~~~~~~~~~~~~ Configurations ~~~~~~~~~~~~~~~~~~~~~
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , _
Db7 = Portc.7 , E = Portc.0 , Rs = Portc.1
Config Pind.2 = Input
Config Porta = Input
Ddrc = &B11111111
' ~~~~~~~~~~~~~~~~~~~~~Main program ~~~~~~~~~~~~~~~~~~~~~
Dim A As String * 10
Dim Dama As Word
Dim Dod As Byte
Dim Harekat As Byte
Dim Rotobat As Byte
Dim K As Word
Declare Sub S_sms(text As Word )
Config Adc = Single , Prescaler = Auto , Reference = Internal
Start Adc
Dama = Getadc(0) : Dama = Dama \ 4
If Dama >= 35 Then
Call S_sms(dama)
End If
End
Sub S_sms(text As Word)
Print "at"
Waitms 500
Print "AT+CMGF=1"
Waitms 500
Print "AT+CMGS=" ; Chr(34) ; "0919xxxxxxx7" ; Chr(34)
Waitms 100
Print "AVR Test 1" ; Chr(26)
Print Text
Waitms 550
End If
End Sub