本帖最后由 gong_wenwu 于 2017-6-20 18:20 编辑
各位大神好!!
小弟刚学
labview要和arduino做串口通讯,读取字符串信息,在上位机转化成波形图。开始运行还正常,大概2分钟左右,波形图就不正常了,出现锯齿。如图1,我自己编的测试程序。问下各位大神,小弟哪里有问题,怎么改?
;
另外附arduino程序:
int p;
void setup() {
// put your setup code here, to run once:
Serial.begin(19200);
}
void loop() {
// put your main code here, to run repeatedly:
for(int i=1;i<=2000;i++){
if(i<=1000){
p=1;
}
else {
p=7;
}
// int x=sine256
;
//int y=random(40);
int Up=1;
int Ui=2;
int Ud=3;
int Uk=4;
int Ek=5;
int F1=6;
int F2=p;
String m ="#";
m+=Up;
m+=",";
m+=Ui;
m+=",";
m+=Ud;
m+=",";
m+=Uk;
m+=",";
m+=Ek;
m+=",";m+=F2;
m+="&";
Serial.println(m);
delay(10);
}
}
一周热门 更多>