examine each digit and add them together with the correct multiplier.
You might have to get fancy to determine the number of digits. To get
the digit from ASCII to decimal, simply subtract 48 from the value and
there you go. Now start right to left and add the Right*(10^0) +
(Right-1)*10^1 + (Right-2)*(10^2)... Until you get to the left digit.
One possible method would be to find the space and then work backwards
from there adding the digit and the multiplier. If you need some help
with the code, let me know and I will try to help you.
--- In oopic@yahoogroups.com, "teh_gamr" <ashraf.hammoud@...> wrote:
>
> Hello all,
>
> I've got a CMUcam tracking an object connected serially to an oopic.
> The camera returns packets of type:
> "T 125 52" where 125 and 52 are examples of the numbers I need,
> followed by carriage return (ASCII 13).
>
> What I need to do is take those two numbers and convert them from
> ASCII to decimal or whatnot.
>
> I can assign the number to an oBuffer object, but it's still in ASCII.
> What to do next?
>
> Thanks,
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment