با سلام من یه برنامه با بیسکام نوشتم برای خوندن از ماژول gps وارسال با sms الان مشکلم اینه که وقتی دیتا را ازgps با دستور input میخونم هیچی رو lcd نشون نمیده در اصل مشکلم با دستورات سریال است چون وقتی از input استفاده میکنم تو همون خط میمونه و از این خط خارج نمیشه برنامه ام را میزارم اگر کسی میتونه کمک کنه در ضمن من دیتا را روی پایه txd دارم
کد:
'**********
'Car Tracer - Date : 20/10/88 - Without PTF Mode
'**********
$regfile "m8def.dat"
$crystal = 11059200
$baud = 4800 'Gps - Hardware -B
$baud #1 = 9600 'Gsm - Software -TX
$baud #2 = 9600 'Gsm - Software -RX
'$baud #3 = 57600 'Gps - Software -TX -A
'$baud #4 = 57600 'Gps - Software -RX -A
'-------------------------------------------------------------------------------
Open "comb.0:9600,8,n,1" For Output As #1
Open "comb.1:9600,8,n,1" For Input As #2
'Open "comb.2:57600,8,n,1" For Output As #3
'Open "comb.3:57600,8,n,1" For Input As #4
'Enable Interrupts
'Config Int0 = Low Level
'Enable Int0
'On Int0 Newsms 'sms ke biad vaghfe roshan mishe
'Enable Urxc
'On Urxc Signal
'Config Serialin = Buffered , Size = 10 'vaghfeye payane ersale dade tavasote GPS
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db7 = Portc.0 , Db6 = Portc.1 , Db5 = Portc.2_
, Db4 = Portc.3 , E = Portc.4 , Rs = Portc.5
'Config Porta.2 = Output
'Config Porta.6 = Output
Config Portd.5 = Output
Config Pind.2 = Input
Dim Nmea As String * 100 'Var Define
Dim Longitude As String * 11
Dim Latitude As String * 10
Dim Ns As String * 2
Dim We As String * 2
Dim Ok As String * 3
'-------------------------------------------------------------------------------
Wait 1
Do
If Pind.2 = 0 Then
Print #1 , "at"
Waitms 500
Print #1 , "at+cmgf=1"
Waitms 500
'Printbin 13
'Printbin 10
'Waitms 100
Print #1 , "AT+CMGS=" ; Chr(34) ; "09373987217" ; Chr(34)
'Waitms 500
'Printbin 13
'Printbin 10
'Waitms 100
Set Portd.5
Input "A" , Nmea
'Nmea = Waitkey()
Wait 5
Latitude = Mid(nmea , 19 , 9 )
Longitude = Mid(nmea , 31 , 10 )
Ns = Mid(nmea , 29 , 1)
We = Mid(nmea , 42 , 1)
Waitms 1
Print #1 , Longitude ; Chr(26)
Waitms 500
Lcd Ns
'Printbin 13
'Printbin 10
'Waitms 100
Reset Portd.5
Print #1 , Ns
Waitms 10
Printbin 13
Printbin 10
Waitms 100
Print #1 , Latitude
Waitms 10
Printbin 13
Printbin 10
Waitms 100
Print #1 , We
Waitms 10
Printbin 13
Printbin 10
Waitms 100
Printbin 26
Waitms 200 'gsm ra be mode sleep mifrestim chon faghat be sms esh niaz darim
End If
'Wait 1
Loop
End
'-------------------------------------------------------------------------------
'Newsms:
'test
'Return
'-------------------------------------------------------------------------------
Signal:
Waitms 1
'Set Porta.6
Input Nmea
Waitms 10
Disable Urxc
Wait 2
'Reset Porta.6
'Set Porta.2
Return
'-------------------------------------------------------------------------------




دیدگاه