2016-06-17 23 views
0

我需要一些指导。我正在学习从arduino发送数据给MIT应用发明者。我可以发送一个串行数据字符串并将其显示在应用程序中。但我想将字符串拆分成变量。下面的程序我正在运行的作品,但不断给出一个列表为空的错误。我如何才能在列表中包含内容时拆分列表。麻省理工学院arduino错误列表中的应用列表空

下面是Arduino的代码

void setup() { 
 
    // put your setup code here, to run once: 
 
    Serial.begin(9600); 
 
} 
 

 
void loop() { 
 
    // put your main code here, to run repeatedly: 
 
    
 
int temp = 22; 
 
int var1 = 19; 
 
int Htemp = 85; 
 
Serial.print (temp); 
 
Serial.print ("?"); 
 
Serial.print (var1); 
 
Serial.print ("?"); 
 
Serial.print (Htemp); 
 
delay (2000); 
 
}

This is screen shot of MIT app

希望有人能帮助或点我在正确的方向

回答

0

摸索出一个办法让这工作,我添加了一个if语句来检查列表是否已满。

enter image description here

相关问题