我目前正試圖用我的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