Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I’m confused

TextFinder and NewSoftSerial don't mix

Unable to use TextFinder with NewSoftSerial
1 person has
this question
+1
Reply
  • TextFinder works fine with NewSoftSerial. If you are having problems, check that you are using the latest versions of both libraries. I tested with NewSoftSerial version 10 and TextFinder from the Arduino playground: http://www.arduino.cc/playground/Code...
    with Arduino releases 21 and 22 using the following sketch:

    /*
    * NssReceiveMultipleFields
    * NewSoftSerial example with textFinder
    * This code expects a message in the format: H 12,-345,678!
    */

    #include "TextFinder.h"
    #include "NewSoftSerial.h"

    NewSoftSerial mySerial(2, 3);

    TextFinder finder(mySerial);
    const int NUMBER_OF_FIELDS = 3; // how many comma seperated fields we expect
    int values[NUMBER_OF_FIELDS]; // array holding values for all the fields

    void setup()
    {
    mySerial.begin(9600); // Initialize nss port to send and receive at 9600 baud
    mySerial.println("Hello, world?");
    }

    void loop()
    {
    int fieldIndex = 0; // the current field being received
    finder.find("H");
    while(fieldIndex < NUMBER_OF_FIELDS)
    values[fieldIndex++] = finder.getValue();
    mySerial.println("All fields received:");
    for(fieldIndex=0; fieldIndex < NUMBER_OF_FIELDS; fieldIndex++)
    mySerial.println(values[fieldIndex]);
    }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I have latest downloads I could find, in proper folder...but still have error in which the Textfinder constructor won't accept my NewSoftSerial object. May we see your particular .h files, Mr. Margolis?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I have latest downloads I could find, in proper folder...but still have error in which the Textfinder constructor won't accept my NewSoftSerial object. May we see your particular .h files, Mr. Margolis?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated happy, confident, thankful, excited

  • You can run the sketch I posted above using the NewSoftSerial library from here: http://rogue-code.googlecode.com/file...

    BTW, there is a newer version of NewSoftSerial in that is available as a beta release from here: http://arduiniana.org/2011/01/newsoft...

    I expect that this version will replace the old SoftwareSerial library in future Arduino releases which is why the library name in that distribution has changed from NewSoftSerial to SoftwareSerial. To use this beta version, replace the SoftwareSerial in the Arduino Libraries directory with the newsoftSerial-11-beta code and change the first few lines of the sketch as follows:

    #include "TextFinder.h"
    #include "SoftwareSerial.h" // was NewSoftSerial.h

    SoftwareSerial mySerial(2, 3); // was NewSoftSerial
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated happy, confident, thankful, excited