Ich hab ein seltsames Problem, und zwar will ich eine Anweisung verwenden die laut http://arduino.cc/en/Reference/StreamReadStringUntil existiert und auch in meiner Datei Arduino\hardware\arduino\cores\arduino\Stream.cpp vorhanden ist...
Aber beim versuch meinen Sketch zu kompilieren meldet mir ArduinoIDE:
:s
Weiß jemand woran das liegen kann?
Hm egal, ich hab jetzt einen möglichen Workaround gefunden:
Code
// Buffer to store incoming commands from serial port
String inData;
char recieved;
void serialEvent() {
if (Serial.available()) {
while (Serial.available() > 0){
recieved = Serial.read();
inData += recieved;
// Process message when new line character is recieved
if (recieved == '\n'){
#ifdef DEBUG
Serial.print("Arduino Received: ");
Serial.println(inData);
#endif
// You can put some if and else here to process the message just like that:
if (inData == "+++\n"){ // DON'T forget to add "\n" at the end of the string.
Serial.println("OK. Press h for help.");
}
inData = ""; // Clear recieved buffer
}
}
// else code what to do with 'recieved' ...
}
}
Alles anzeigen
Quelle: http://stackoverflow.com/questions/5697…g-using-arduino
..jetzt hab ich aber Probleme mit der NewPing.cpp, aber das is hier ja nun wieder Offtopic =(