Pages: 1 [2]   Go Down
Author Topic: Problems with Serial Bus  (Read 914 times)
0 Members and 1 Guest are viewing this topic.
New Jersey
Online Online
Faraday Member
Karma: 72
Posts: 3763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You're going to need to service serial quite frequently to avoid buffer overflow. Every 200ms is not going to cut it - theoretically, you could get ~190 characters delivered in that time. Post (attach) your code if you need assistance in refactoring it to achieve this.

Offline Offline
Tesla Member
Karma: 148
Posts: 9750
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I put a , on the end of your string and the below code returned the entire string to the serial monitor.

//zoomkat 3-5-12 simple delimited ',' string parce
//from serial port input (via serial monitor)
//and print result out serial port
// CR/LF could also be a delimiter

String readString;

void setup() {
  Serial.println("serial delimit test 1.0"); // so I can keep track of what is loaded

void loop() {

  //expect a string like wer,qwe rty,123 456,hyre kjhg,
  //or like hello world,who are you?,bye!,
  if (Serial.available())  {
    char c =;  //gets one byte from serial buffer
    if (c == ',') {
      //do stuff
      Serial.println(readString); //prints string to serial port out
      readString=""; //clears variable for new input     
    else {     
      readString += c; //makes the string readString


Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Pages: 1 [2]   Go Up
Jump to: