[Newbies] communication with serial port
benschroeder at acm.org
Wed Nov 1 01:23:47 UTC 2006
On Oct 31, 2006, at 5:24 PM, remin at elgen.dk wrote:
> hello to all,
> i am new in this forum... so forgive me if this subject has been
> posted before!
> (is there an archive of old posts on the beginners list? i cant see
> it at http://www.lists.squeakfoundation.org/cgi-bin/ezmlm-browse)
> is there any good tutorials/examples on how to communicate with the
> serial port? for beginners of squeak?
> i am building a physical computer interface and display which i
> would like to control the functionality of with squeak. the
> physical controller is the arduino board (www.arduino.cc) linked to
> the computer via USB (since my laptop has no serial plug i use a
> serial->USB converter). the serial monitor in the arduino
> environment works perfectly fine (i get lots of input), so i guess
> the USB signal is treated like a serial signal via the arduino USB/
> serial software/drivers.
What operating system are you running on?
I also have an Arduino. I use Mac OS X, and my board shows up as a
Unix device, in /dev/cu.usbserial-something or other. (I'm afraid
I've left the board at the lab so I can't check right now! :)
Squeak has a SerialPort class, but I'm not sure how to get it to
recognize serial ports on OS X. I hear it works well on Windows - and
maybe Linux - but I'll leave explaining it to folks who know better.
It looks like Ned Konz wrote a short introduction to it recently, at
(The rest of the archives are at "http://lists.squeakfoundation.org/
pipermail/beginners/" - I think it must just be on a different
mailing list system than the page you found.)
On OS X, I've instead written a small C library to read and write the
serial port, and talked to it using Squeak's "FFI" functionality.
(FFI stands for Foreign Function Interface, and it's a way to call
external libraries from Squeak.) I've had success talking to the
Arduino this way.
I'd be happy to share my Unix/OS X code if it would help - let me know!
More information about the Beginners