[Tutor] More confusion on conversion

Vicki Stanfield vicki at thepenguin.org
Fri Oct 31 09:09:10 EST 2003


> In my last mail I had a bit of a brain freeze :-(.  '0' is not 0, but is
> in fact 48 or 0x30 or 00110000.  This means that
>
> port.write('\x30')
> port.write('\x41')
>
> should be equivalent to
>
> port.write('0A')
>
> which is equivalent to
>
> length = 10
> port.write('%02X' % length)  # one of my previous suggestions
>
> so I don't see why that isn't working for you.  Hopefully someone else
> can see the error of my ways and point you in the right direction.
>
> Reggie

I'm still trying to iron this one out, but the reason that the
port.write('0A') doesn't work is because I need to add a slight delay
between the two bytes. I thought I said that before, but I might not have.
This whole mess frustrates me.

I am trying the different suggestions that I received last night. I will
post what works.

--vicki



More information about the Tutor mailing list