FullDuplexSerial Strings Containing Variable
coryco2
Posts: 107
I would like to use FullDuplexSerial's Str method to send a string of long-sized values that include both fixed numbers and variables, e.g.
serial.str (string( $01, $02, variable3, $04 ))
but the compiler doesn't like the variable in there, even proceeded by an "@". Why not? Is there any way to make this work?
serial.str (string( $01, $02, variable3, $04 ))
but the compiler doesn't like the variable in there, even proceeded by an "@". Why not? Is there any way to make this work?
Comments
You must use "dec" to send variables.
serial.dec(variable3)
Bean
If you're trying to send people-readable numbers (a sequence of digits), use the .dec() method. If you want to send the content of a long variable as a sequence of 4 bytes, you'll have to use .tx() or write your own routine that then calls .tx() like this: