explain this

Mar 10, 2013 at 11:40pm

explain this

im sending a list to serial,
why does this patch of sprintf/itoa doesn’t keep a length of 3?

– Pasted Max Patch, click to expand. –
#66999
Mar 11, 2013 at 5:55am

hello yair reshef…i have give you a brief explanation in the example patch….

– Pasted Max Patch, click to expand. –
#241153
Mar 11, 2013 at 7:02am

Hi,

And problem occurs not only with a zero (as explained by tada) but for a bunch of numbers that gives an empty result with “%c” (and those ‘nothing’ empty result is not counted by [zl len]).

– Pasted Max Patch, click to expand. –
#241154
Mar 11, 2013 at 9:09pm

im drowning and your describing the water.:)

so a quick fix to keep using that method to pass serial
is to offset by 1 and subtract on the other end (?)

#241155
Mar 12, 2013 at 7:30am

Hi,

1. There is various solutions, but you should precise your aim if you want clever help.
2. Here a quick patch to translate Int to Hex (it can be improved certainly).

– Pasted Max Patch, click to expand. –
#241156
Mar 12, 2013 at 7:44am

Hi,

Oops.

1. Good advice i should have done myself : “search first in the forum” ;-)
2. But my previous patch still can be used if you want to code your proper secret alphabet.

– Pasted Max Patch, click to expand. –
#241157
Mar 12, 2013 at 4:32pm

Could it be because chr(0) is the string termination character?

#241158

You must be logged in to reply to this topic.