[Newbies] Re: Cuis USB?

David T. Lewis lewis at mail.msen.com
Fri Nov 13 21:44:04 UTC 2009

On Fri, Nov 13, 2009 at 12:35:00PM -0800, Overcomer Man wrote:
> A good computer language should give progammers complete control over all
> aspects of the machine from multiple processors to all peripherals, making
> an Operating System unnecessary.  Is Smalltalk such a language?  If so
> where's some example USB code?

The simple answer is no, Smalltalk is not such a language. But it is
possible to use it in that manner, and many people use it for device control
and run it without an operating system (google "SqueakNOS" for example).

With respect to your original question, I am not currently using USB serial
ports with Squeak or Cuis, but I believe that you can do so as follows:

- Load the class SerialPort into Cuis. You can file this out from the latest
Squeak trunk image, and I have attached a copy of it to this mail.

- Use the latest virtual machine for your platform. This will have the
necessary support for accessing named serial devices.

- In Cuis, make an instance of SerialDevice and use it to open your USB
serial device and read and write to it. This will probably look something
like this:

  myUsbPort := SerialPort new.
  myUsbPort openPort: '/dev/someUsbDevice'.
  myUsbPort nextPutAll: 'some data to send'.
  responseString := myUsbPort readString.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: serial.zip
Type: application/zip
Size: 6291 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091113/3d18cbaf/serial-0001.zip

More information about the Beginners mailing list