How do I write a debug var on console but not on the serial hardware?
I tried Console.write; I tried Serial.flush().
The problem is when I print the return value (rep) for debugging it is also sent to my hardware on RX/TX and creating errors.
int start_of_text = 0x02; int end_of_text = 0x03; String cmd = "cmdtosend"; String rep = "returnvalue"; void setup() { Serial.begin(115200); } void loop() { cmd = "TV,100"; writeCOM(cmd); } void writeCOM (String cmdtosend) { cmd = "\02\02" + cmdtosend + "\03"; Serial.print(cmd); delay(200); if (Serial.available() > 0) { rep = Serial.readString(); } cmd = " "; rep = " "; delay(800); } 31 Answer
If I am not wrong it is impossible, because these code is running on arduino, not on your computer. If you want see something from uC you must send it by serial.