我目前正试图用我的arduino构建一个非常基本的串行shell。将字符添加到字符串
我能够使用Serial.read()从设备获取输出,并且可以获取已输出的字符,但是我无法确定如何将该字符添加到更长的时间以形成完整的命令。
我试图顺理成章的事情,但它不工作:
char Command[];
void loop(){
if(Serial.available() > 0){
int clinput = Serial.read();
Command = Command + char(clinput);
}
有人能帮忙吗?谢谢。
命令犯规点 – pm100 2010-03-26 23:33:05
非常感谢,我硬是花了一天谷歌搜索:d – Jamescun 2010-03-26 23:33:43