in reply to serial raw write problem with multidigit decimal and strings

I know nothing about basic, but if it sounds like you're talking about bytes and bits, so you should probably see pack, perlpacktut

I imagine you might need  print USB pack 'c', 150

  • Comment on Re: serial raw write problem with multidigit decimal and strings (bits bytes pack)
  • Download Code

Replies are listed 'Best First'.
Re^2: serial raw write problem with multidigit decimal and strings (bits bytes pack)
by ultibuzz (Monk) on Mar 10, 2013 at 20:09 UTC

    pack looks like a good start, i'll experiment with it a bit :)
    pack 'i' 150 works as expected submits 150,
    pack 'c' 150 produces warning "Character in 'c' format wrapped in pack" and submits garbage, 150 is not a char i would guess :)
    i'll test some more complex things and will come back with the results.

    kind regards
    alex



    UPDATE
    pack seems to work in some cases, but also produces funny results in other cases.
    As it seems,it depends on the function it is used on, will further experiment with it.