This archive contains the source code, make files, etc for the
"Serial to Peggy2 plugin", Copyright 2008 by Jay Clegg.  All rights reserved.  
Released under GPL license.  See COPYING.txt for more license information.

//////////////////////////////////////////////////////////////////////////////
I am releasing this code and the information for how it works 'as-is' and 
make *NO* guarantees that it will not cause damage to your peggy2, your
Arduino, your computer, your immediate surroundings, your health, or your 
sanity.
//////////////////////////////////////////////////////////////////////////////

More information about this project, here

http://www.planetclegg.com/projects/VideoPeggyMisc.html
http://www.planetclegg.com/projects/QC-Peggy.html

You will need XCode 3.0 or higher on Leopard to compile this plugin, and 
Quartz Composer to use it.  

Opening the QCSerialPatch.xcodeproj file should open the project in XCode.
After building in XCode, copy the resulting ".plugin" file into your
"~\Library\Graphics\Quartz Composer Plug-Ins\" folder.  You may need to
create this folder if it doesnt already exist. 

The plugin should show up as a patch called "Serial to Peggy2" in the Patch
Creator when you restart QC. 

You may be able to set the target in XCode to "Build and Copy" and have 
XCode copy the plugin for you. 

The patch needs to be configured:  There is a property for a serial port, 
set this to your Arduino or serial adapter port name, typically something 
like "/dev/tty.usbserial-XXXXXXXX".   There is no real error feedback, 
so if you give it something that doesnt exist, it may either freeze the 
composition or just ignore it.  The error handling could use improvement, 
so exercise caution. 

Some notes on using the plugin:   

The patch expects an image, which needs to be sized.  If it is anything other
than 25x25, it will resize it to 25x25 internally before sending it to the 
Peggy. This can have the effect of messing up the aspect ratio on the Peggy
side if the source image is not square.   If you want to do scrolling text, 
for example, the easiest way to do that is to create a square cropped image 
that moves along a larger image containing the full text.   

The color-to-gray scale calculation in the patch is very crude (average of 
R,G,B values), so you'll generally get better results if you pre-process 
color images with the Monochrome patch.  The Movie composition demonstrates 
this.

Under some conditions the image in the QC viewer window may flicker.  I don't 
see this very often and I'm not sure how to reliably reproduce it. 

Two simple compositions are included: one plays a movie (you have to supply 
a movie file), one just makes some moving circles.  You'll need to edit the 
serial port property as described above and then set "enable" to true on 
the peggy patch for each of these.  


Files:

README.txt                  Er, this file.
COPYING.txt                 License.  Read it!
peggy-circle-dance.qtz		Two circles move around the screen.  Simple.
peggy-movie.qtz				Plays a quicktime movie (you supply the movie)

Everything else is part of the XCode project for the plugin....
