ارتباط سریال بین matlab و AVR
ارسال شده: دوشنبه ۱ مهر ۱۳۸۷, ۹:۵۳ ب.ظ
ارتباط سریال بین matlab و AVR
برنامه matlab :
[align=left](S = serial('COM1','BaudRate',9600,'DataBits',8
( fopen(S
( ' هر چی می خواین بفرستین',fprintf(S
( fclose(
برنامه AVR
[align=left]
regfile = "m8def.dat"$
$crystal = 4000000
baud = 9600$
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.5 , Db5 = Portc.4 , Db6 = Portc.3 , Db7 = Portc.2 , E = Portc.1 , Rs = Portc.0
Dim S As Byte
Do
Cls
()S = Inkey
Lcd S
Wait 1
برنامه matlab :
[align=left](S = serial('COM1','BaudRate',9600,'DataBits',8
( fopen(S
( ' هر چی می خواین بفرستین',fprintf(S
( fclose(
برنامه AVR
[align=left]
regfile = "m8def.dat"$
$crystal = 4000000
baud = 9600$
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.5 , Db5 = Portc.4 , Db6 = Portc.3 , Db7 = Portc.2 , E = Portc.1 , Rs = Portc.0
Dim S As Byte
Do
Cls
()S = Inkey
Lcd S
Wait 1