i trying send string 1 mega other , have done doing this:
that works great. wanted build string before sent it. took next step further , tried saving same string variable , send variable, this:
this seems work fine(or else did me) getting error: "no matching function call 'hardwareserial::write(string&)' "
not sure why error happening because sending same string. appreciated. if has better way send string "serial1.write()" command ears well.
thanks in advance
code: [select]
void setup() {
// initialize both serial ports:
serial.begin(9600);
serial1.begin(9600);
}
void loop()
{
serial1.write("0;200;");
delay(2000);
}
that works great. wanted build string before sent it. took next step further , tried saving same string variable , send variable, this:
code: [select]
void setup() {
// initialize both serial ports:
serial.begin(9600);
serial1.begin(9600);
}
void loop()
{
string boss = "0;200;";
serial1.write(boss);
delay(2000);
}
this seems work fine(or else did me) getting error: "no matching function call 'hardwareserial::write(string&)' "
not sure why error happening because sending same string. appreciated. if has better way send string "serial1.write()" command ears well.
thanks in advance
Arduino Forum > Using Arduino > Programming Questions > Send string from mega to mega
arduino
Comments
Post a Comment