[Tutor] sending hex data on port

vicki@stanfield.net vicki@stanfield.net
Wed Jun 18 14:27:16 2003


I am working on a project which requires that I read
data in from a file and send the hex equivalent out on
the serial port. I have everything except how to send
the data in hex format. I have looked through a lot of
apps but most are really more complicated than I am
ready for. If I simply try to do this:

port.write(hex(18))

It translates the 1 to hex and then the 8 to hex. I
realize this is quite simplistic, but it is really all
I need to do. If I put '18', it complains about not
being able to convert a hex value to a hex value.

Pardon my ignorance, but can someone please point me in
the right direction?

--vicki