"no matching function for call to 'println(String [80])"

Hi everybody,

Can someone help me with the subject message?

Here is my code:

"
#include <SoftwareSerial.h>

SoftwareSerial portOne(1, 0); // RX, TX
String jules[6]=“jules”;
String inData[80]="";
int index = 0;

void setup() {
Serial.begin(19200);
portOne.begin(19200);
}

void loop() {
Serial.println(“Data from port one:”);
delay(1000);

if (portOne.available() > 0) {
if (inData[index]!=0){
inData[index]= portOne.read();
inData[index] = Serial.read();
index++;
Serial.println(inData);
if (inData=jules){
Serial.println(“Jules inside”);
}
}
}
"

Thanks for helping!

Getting your code to compile will be a waste of time. It can't possibly work.

SoftwareSerial portOne(1, 0); // RX, TX

You can NOT do software serial on the hardware serial pins, while doing hardware serial on them.

String jules[6]="jules";

An array of 6 Strings, with one initializer?

String inData[80]="";

An array of 80 Strings? Why?

Get rid of the String class. Do NOT use Strings. Use NULL terminated arrays of chars, instead.

Where shall we start ?

String inData[80] = "";

This declares an array of 80 Strings, not a String of 80 characters

Serial.println(inData);

Which one of them do you want to print ? You have not told the compiler, hence the error message

String jules[6] = "jules";

An array of 6 Strings

     if (inData = jules)

Which of the 80 Strings do you want to compare with which of the 6 Strings ? In any case you are not comparing anything because you used = instead of ==

I'm scanning a qr code through the RX pin, so the code is comming "char by char".

Thats why i would like to put it in an array.. How can I do so?

After that I would like to compare that string with an other one that would already be inside my code.

Am I understandable?

declare an array of chars large enough for the longest input +1 for the terminating '\0' set the array index = 0

receive a character if it is not the end of input character put it in the array at the current position increment the array index put '\0' in the current position to terminate the string go back for the next character else the complete string has been received and is ready to use

NOTE the use of strings ('\0' terminated arrays of chars) rather than Strings (objects created by the String library)

The serial input basics tutorial shows how to read serial data into a null terminated character array.

Versaille: I'm scanning a qr code through the RX pin, so the code is comming "char by char".

Thats why i would like to put it in an array.. How can I do so?

After that I would like to compare that string with an other one that would already be inside my code.

Am I understandable?

Use a char array.

Look at the standard string.h library. I think strcmp() or strncmp() will be most useful to you. My favourite reference for this is cplusplus.com

Thks everybody, I’m getting sick of that code. Even my teachers can’t help me…

"

#include <SoftwareSerial.h>

SoftwareSerial portOne(1, 0); // RX, TX
char inData[4];
int index = 0;

void setup() {
Serial.begin(9600);
portOne.begin(9600);
}

"

"
if (portOne.available() > 0) {
if (inData[index]!=0){
inData[index]= portOne.read();
inData[index] = Serial.read();
Serial.println(inData);
if (inData==“AB”){
Serial.println(“AB inside”);
}
index++;
}
"

I don’t how to finish my char, I’m sorry, can you write it to me?

SoftwareSerial portOne(1, 0); // RX, TX

I don't approve of using capitals in replies but I can't help myself AS POINTED OUT IN REPLY #1 DON'T USE THESE PINS FOR SOFTSERIAL

Where is the input coming from ?

if (inData=="AB")

This will never be true. Have you tried printing inData after adding each byte to it ? I assume not because you used the hardware Serial pins (0 and 1) for SoftSerial.

How can I get the qr code otherwise than theses pins? I on ly have the arduino uno? Is that possible to configure others pins?

Is that possible to configure others pins?

For software serial? Yes. That is EXACTLY why SoftareSerial's constructor takes two pin numbers.

You can use just about any pins you like for SoftSerial except 0 and 1

The analog inputs can be used for SoftwareSerial, too, because they can also be digital pins.