来自arduino错误列表的MIT应用程序列表为空

时间:2016-06-17 22:37:58

标签: arduino

我需要一些指导。我正在学习将数据从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

希望有人可以帮助或指出我正确的方向

1 个答案:

答案 0 :(得分:0)

找到一种方法让它工作,我添加了一个if语句来检查列表是否已满。

enter image description here