I have an Arduino Uno R3, and unfortunately, I don’t have any displays. What do you mean by:
I am looking at the function, and it’s only saying how many bytes are passing through. I think instead what you mean is to use “readStringUntil()” since the context makes a bit more sense for this. I have made the line-feed character a lowercase “c” just for testing purposes.
Heres is what I have for the Arduino now(still not working):
void loop() {
//Serial.println("ok so the loop started");
// put your main code here, to run repeatedly:
while (Serial.available()>0){
String MotorCode = Serial.readStringUntil("c");
if (MotorCode.substring(0) == "C"){
Claw.write(map(MotorCode.substring(1,-1).toInt(), 0, 180, 0, 180));
digitalWrite(LED_BUILTIN,HIGH);
}
else {
digitalWrite(LED_BUILTIN,LOW);
}
}
I have a feeling it has something to do with how I am decomposing the string, as I don’t know much about decomposing strings in Arduino.