[C.CC USERS] serial.write.int question

Matt Jadud matt at jadud.com
Thu Oct 27 21:20:21 BST 2011


Hi Aaron,

On Thu, Oct 27, 2011 at 14:32, Aaron Ryan <bringfire at gmail.com> wrote:
> Hey Guys,
> I am getting all HEX values from the serial.write.int () PROC.Which makes
> sense looking at "printing.module"  Is there a Process that converts HEX to
> DEC?

I sometimes forget what is in the modules, even if I wrote some of the code.

PROC serial.write.dec.int (VAL INT port, VAL INT n)

That will output a value as a decimal. I'll add it to the cookbook in
the obvious place (at the moment).

The bigger question is whether the default should be to print in
decimal and require the user to specify hex when they want it? That,
most likely, is the better behavior.

> Are the PROCs described in the docs on this site available in the KROC build
> of the Transterpreter?
> http://occam-pi.org/occamdoc/convert.html#name-HEX32TOSTRING

This is a good question. I think there are some tricky problems that
the group has never decided to tackle having to do with the 16-bitness
of the Arduino in making some of those routines work. Anyone else have
a comment on this part of the question?

Cheers,
Matt



More information about the users mailing list