concatenate ints with cons chars
hi
i trying print following on 1 line
mapped_aux1, etc integers.
however following error when compiling,
serial_coms:159: error: lvalue required left operand of assignment
if use "/" instead of '/' following,
serial_coms:159: error: invalid conversion 'const char*' 'int'
serial_coms:159: error: assignment of read-only location '",,"'
i know can using
etc, serial.println @ end.
however can cause problems vb program creating arduino communicating if arduino starts printing half way down line when port first opened.
any or ideas appreciated.
thanx
i trying print following on 1 line
code: [select]
serial.println(',,' += mapped_aux1 += '/' += mapped_aux3 += '/' += mapped_gear += '/' += mapped_flaps += '/' += wf_c += '/' += wf_wl += '/' += wf_fuf += '/' += lg_ud += '/' += lg_doors += '/' += lg_bof += '/' += cf_pos += '/' += cf_am += '/' += e_temp += '/' += e_choke += '/' += e_imomb += '/' += e_starter += '/' += c_oc += ',');
mapped_aux1, etc integers.
however following error when compiling,
serial_coms:159: error: lvalue required left operand of assignment
if use "/" instead of '/' following,
serial_coms:159: error: invalid conversion 'const char*' 'int'
serial_coms:159: error: assignment of read-only location '",,"'
i know can using
code: [select]
serial.print(",,");
serial.print(mapped_aux1);
serial.print("/");
etc, serial.println @ end.
however can cause problems vb program creating arduino communicating if arduino starts printing half way down line when port first opened.
any or ideas appreciated.
thanx
some research on sprintf() and/or snprintf() functions pay dividends you.
Arduino Forum > Using Arduino > Interfacing w/ Software on the Computer > concatenate ints with cons chars
arduino
Comments
Post a Comment