Wednesday, May 28, 2008

TouchShield: Mac OS X Image Uploading!

In the past, Mac users had to flip over into Windows XP to send their bitmap images to the TouchShield. That was then, and this is now...

because there is a TouchShield bitmap image uploader for Mac OS X!

Thanks to everyone for all your help!

The files are and touch-007(mac).zip and are posted on as interim releases for testing. When it's free of bugs, it'll be merged with standard touch core and released as the touch-008 release.

It should even run on other *nix OS's too!

What you'll need,
rubyUploader-001 (
TouchShield Arduino API (touch-007(mac).zip)

The TouchShield code,

COLOR blue = {0,0,255};
COLOR black = {0,0,0};
COLOR white = {255,255,255};

void setup()

void loop()


Upload the above app to the TouchShield.

Then execute,
# ruby rubyUploader.rb -port /dev/tty.usbserialXXXXX

Remember, you need to replace XXXXX with your correct serial port.

rubyUploader takes any 24-bit bmp images that are in the script's directory and sends them all to the TouchShield.

Good luck,

Questions? Leave a comment, or shoot me an email:


Robert Kosara said...

This doesn't work on a Mac, because the is a Windows DLL, according to file. Ruby can't load it. I wonder if it's even needed, doesn't Ruby have support for the serial port built in?

Chris said...

At the time of creating this app, ruby didn't have native serial support.

You will need to install Xcode from your Mac OS X cdrom that shipped with your computer. To build ruby-serialport.


Install serialport by executing,
$ ruby extconf.rb
$ make
$ make install

That should do it!

Dems said...

It still doesn't work on my Mac.. now it gives the following Error..

245:rubyuploader Dems$ ruby rubyUploader.rb -port /dev/tty.usbserial-6004neQ
Image size: 25506,Width: 83,Height: 101, File Name: |applelo|
Image size: 49206,Width: 128,Height: 128, File Name: |spears5|
(eval):3:in `create': No such file or directory - /dev/tty.usbserial-6004neQ (Errno::ENOENT)
from (eval):3:in `new'
from ./serial.rb:12:in `sendPages'
from rubyUploader.rb:55
245:rubyuploader Dems$

Dems said...

Can someone help me with that... I already tried everything!

Chris said...


It seems like the program can't initialize your serial port.

There are usually two devices listed under the /dev/ folder have you tried passing in the other one?

You can also contact me on if it's easier.


Chris said...


I'm glad we got it working!

To recap, manually writing your serial port name in the serial.rb file made it work.

Good luck with the rest of your project!


Unknown said...

Where do we put the RubyUploader folder in the Arduino folder? I've gotten it to work as far as displaying "starting..." on the screen but then it stops so I'm assuming I put the Ruby Uploader files in the wrong place?