[squeak-dev] Question about serial port communication

Víctor C. T. victorct83 at gmail.com
Sat Jun 20 15:18:03 UTC 2009


Ups sorry, it was a mistake, the code I have is:

sendHello: SerialPort2
| ba |
ba := ByteArray new: 2.
ba at: 1 put: 16r30.
ba at: 2 put: 16r20.
SerialPort2 nextPutAll: ba.

2009/6/20 Jon Hylands <jon at huv.com>

> On Sat, 20 Jun 2009 16:37:53 +0200, Víctor C. T. <victorct83 at gmail.com>
> wrote:
>
> > sendHello: SerialPort2
> > | ba |
> > ba := ByteArray new: 2.
> > ba at: 1 put: 16r30.
> > ba at: 1 put: 16r20.
> > SerialPort2 nextPutAll: ba.
>
> You're putting both bytes at location 1 in the ByteArray, at least in this
> code, so you're sending (0x20 0x00), instead of (0x30 0x20)...
>
> Later,
> Jon
>
> --------------------------------------------------------------
>   Jon Hylands      Jon at huv.com      http://www.huv.com/jon
>
>  Project: Micro Raptor (Small Biped Velociraptor Robot)
>           http://www.huv.com/blog
>
>


-- 
Víctor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090620/c98b1774/attachment.htm


More information about the Squeak-dev mailing list