Josiemay icon

Google Chrome Extension ** RECOMMENDED ** With this Google Chrome Extension you are able to create n

Josiemay | 06/18/25 05:35:48 AM UTC | 0 ⭐ | 232 👁️ | Never ⏰ | []
HTML |

890 B

|

None

|

0 👍

/

0 👎

//This example Arduino Sketch is for use on Arduino Uno/Nano/Micro (or equiv. clone boards)
// -Problem of serial read timeout on Micro with USB CDC Serial hardware not present on Uno/Nano/Mini
// --complete details here: 
// https://github.com/SemlerPDX/ArduinoConsoleAppTest1
 
 
void WriteMethod_Characters(String dataToSend) {
  for (int i = 0; i <= dataToSend.length(); i++) {
    Serial.write(dataToSend.charAt(i));
  }
}
 
void setup() {
  Serial.begin(9600); // Define speed at 9600 baud
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB
  }
}
 
void loop() {
  String dataPrints = "";
  dataPrints.concat("[Hello,");
  dataPrints.concat(Serial.availableForWrite());
  dataPrints.concat(",World]");
  
  //This issue occurs regardless of print()/println()/write() methods
  WriteMethod_Characters(dataPrints);
  delay(1000);
  Serial.println();
}

Comments