So I was trying to communicate between two Arduinos, for which I was using the following link to get an idea:
But I am facing an issue with the
Serial.readBytes and Serial.write commands the error message is as follows:
Test:50:31: error: no matching function for call to 'HardwareSerial::readBytes(int [2], int)'
Serial.readBytes(message,2);
And a similar one for the sender section:
sketch_jun28a:148:25: error: no matching function for call to 'HardwareSerial::write(int [2], int)'
Serial.write(message,2);
Could somebody please clarify whether i need to include some library or what is the issue?
The following is the code which I used for the sender Arduino
message[0] = round(fill_ratio);
message[1] = round(estd_time);
Serial.write(message,2);
There's a clue in the error message (look at the array) and the name of the function "readBytes".
Please remember to use code tags when posting all of your code
1 Like
A copy / paste from the linked code to the IDE on my laptop compiles out-the-box. You should try that before making any changes.
1 Like
I'm really sorry but I didnt understand.
Also what are code tags as I am new to the community it would be helpful if you could clarify it , I'll try to do it properly the next time.
Thanking you in advance.
Okay I'll try that thank you.
Explained in the sticky at the top of the forum:
1 Like
Thank you all it got solved as I changed the variable type of message from int to char
system
Closed
8
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.