Archive for April, 2005


Mac OS X USB LCD

Sunday, April 24th, 2005

I’m working on a small project which will allow you to connect a small LCD to your Mac via USB, and I’m curious if people have any suggestions as to what they would use it for — current iTunes track, unread mail, RSS headlines? At right you can see an image of the circuit I’ve put together. The chip on the left is a Cypress USB interface from Delcom Engineering, and the one on the right is a standard MAX232 chip, which converts signal levels to RS-232 from the Cypress chip. Using these two together, you can send RS-232 data from your Mac, and I’ve connected it to a serial LCD from Scott Edwards Electronics (the most expensive part of the project), and am able to send any data to the LCD, even control the backlight!

I intend to build up a full page about how I did it in the very near future, but I’m still working on the C code which does the work of talking to the USB I/O chip. Right now, though, I’m looking for suggestions of things to implement for the release. If you have a neat idea, post it in the comments. I’ll be working with a 4 line by 20 character LCD, if it helps.

Update: Also, if anyone has a preferred way of getting data to the LCD, post that as well. Would you prefer AppleScript, Python, something else? I’m sure AppleScript will be involved somewhere along the way to communicate with Mac OS X apps, but what about the “glue” between that and my command-line app? I’m partial to PHP, but it’s not used very often as a system-level scripting system.

jpegextractor

Sunday, April 24th, 2005

I recently found a cool little open source Java program called “jpegextractor” which looks for JPEG images inside of other files, regardless of their type. It can accomplish this because JPEG files have a short but distinct beginning and end marker. Jpegextractor runs through a given file looking for occurrences these two blocks, and if found, copies the data between them to new JPEG image files on your disk.

One purpose I’ve found for it is extracting the artwork from purchased iTunes songs via the command line, as the cover art is stored as JPEG data inside the MPEG-4 protected file (however, only the audio is encrypted, not the cover image). It is possible to copy the artwork out via iTunes song info window, which I found out later.

Using jpegextractor isn’t hard at all. With it downloaded, cd to the jpegextractor folder, and then do java jpegextractor /path/to/file.m4p, replacing /path/to/file.m4p with whatever file you want to juice for JPEG images. If anything is found, it will dump out an “output0.jpg”, or more, numbered sequentially.

$ cd ~/Desktop/jpegextractor/
$ java jpegextractor Ready\ to\ Rise.m4p
Ready to Rise.m4p
=>output0.jpg (519887 bytes)
Extracted 1 JPEG file(s) with 519887 bytes from 1 input file(s).

jpegextractor homepage

Little Snitch

Friday, April 22nd, 2005

One of my favorite behind-the-scenes programs for Mac OS X is a network filter called Little Snitch. It allows you to limit any outbound network connection that your Mac makes, and permit or deny it based on the server address, port, or both. For example, if a new program tries to connect to the internet send data out to a server, Little Snitch pops up and asks you what you want to do. At that point, you can allow or deny the connection once, forever, or until the application quits.

It has recently been updated to work with Mac OS X 10.4, and the upgrade is free. It sells for $24.94, but I find it quite valuable, and it gives me peace of mind that no programs are sending out anything I don’t want them to.

Little Snitch homepage | MacUpdate page

Xbox USB Controller Driver

Sunday, April 17th, 2005

Have you ever wanted to be able to use your Xbox controller as a gamepad for your computer games as well as your Xbox games? Darrell Walisser has released a 1.3 update to his great Xbox controller software, which is a kernel-level human interface driver for Mac OS X. It works at a low level so that any controller-aware game will be able to use it. It requires Mac OS X 10.2.6 or later, and is $5 shareware.

For the task of physically connecting your Xbox controller to your Mac, you can either buy an adapter from lik-sang.com or build your own by splicing the Xbox wires into a USB cable. If you build your own, the wire colors should match, but ignore the yellow wire coming from the Xbox controller — it’s for powering a light gun used in a small few games.

With the controller connected to your computer and the driver installed, it’s easy to set up your favorite game to use it.

Xbox HID Driver homepage | MacUpdate page