MultiCogSerialDebug need helping sending a Variable
Dgswaner
Posts: 795
I'm having trouble with some code and I really need to be able to see what some variables are doing. I've tried to use the Multicogserialdebug object but I can't get the syntax right to send a variable. I looked at the notes in the object comments but I still can't make heads or tails of it. can someone help me out.
debug.cprintf(string("DIRECTION %s\r"),RANGE,false) is what I have the %s is just the last thing I tried. from what I understand this should display "DIRECTION ### [noparse][[/noparse]RETURN]"
### being the value of the Range VAR. and [noparse][[/noparse]RETURN] being a well a return.
all I'm getting is "DIRECTION "
any text I send shows up. just not vars.
Thanks for any help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster
DGSwaner
debug.cprintf(string("DIRECTION %s\r"),RANGE,false) is what I have the %s is just the last thing I tried. from what I understand this should display "DIRECTION ### [noparse][[/noparse]RETURN]"
### being the value of the Range VAR. and [noparse][[/noparse]RETURN] being a well a return.
all I'm getting is "DIRECTION "
any text I send shows up. just not vars.
Thanks for any help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster
DGSwaner
Comments
one of the integervalue format specifiers: %d(=%i),%b,%o,%u,%x
If RANGE is a character, eg. "A", and you want to print the character, use %c
If RANGE is a null terminated byte buffer, you must use %s, but specify @RANGE
as cprintf in that case expects an address.
regards peter
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster
DGSwaner