Serial Wombat
a general-purpose digital interface device for hobbyists, engineers and students

 


Home
Overview
Protocol
Documentation
Getting Started
Connectivity
Pin Mode SDK Beta
Sample Projects
WombatPanel
iTunes Control
Serial To TCP/IP
QBasic
'C'
Solar Water Display
Downloads
Contact Us
Purchase
Forum

Did you know...

 

Introduction

The Wombat iTunes Control is the second released sample application for the Serial Wombat. It is written in C#, using Microsoft's free Visual C# Express development environment.

This application makes use of Apple's fantastic SDK for iTunes. This kit allows you to control iTunes using a COM interface (Component Object Model, not COM port...). In C# express, all you have to do is add a reference to your project to the COM interface.

As I said in the last sample project, I'm a rotten Windows programmer. I spend my days writing embedded systems software, mostly in C and assembly for devices which don't have a graphic user interface, like the Wombat itself. But I'm getting better. If you have constructive criticisms of how I've designed and written this application, I'd love to hear them. Please use the contact page on this site.

This application is designed to show how to use a number of Wombat Features (check out the video):

Play Video

  • The LCD support for the WDC2401P that's flooded the surplus market lately. We'll use the Wombat's on-board capability to scroll a stored string which is longer than 24 characters. We'll use this to display the artist, name, and elapsed time of the playing track. The display is hooked up as follows:
    E pin: 15
    RS pin: 14
    Reset pin: 13
    D0 through D8 pins: 16 through 23
  • Rotary Encoder support. A rotary encoder is a digital knob, frequently used on the front of car radios. We'll use this to change tracks in iTunes. I used this one (the quadrature model), available from Digikey as part number GH3072-ND. The common on the Rotary Encoder is attached to ground, and the A and B outputs are hooked up to Wombat pins 39 and 40. Since the Wombat's internal pull-ups are turned on, we don't need external resistors.
  • Averaged Analog measurement. We'll measure a voltage value from a potentiometer using the A/D channels. Since this application only reads the pot 4 times a second, we might as well average a bunch of samples (by default we sample 1000 times per second), and provide a nice averaged value. This can help in filtering out noise. We'll use the pot for iTunes volume control. I'm using a 1k pot which is acting as a voltage divider between +5v and ground. Use a 5k pot or less, otherwise you won't meet the impedance requirements for the 18F4620 chip the Wombat is based on.
  • Input Counter. We'll use a common button switch to provide Play/Pause functionality. Since we don't want the host to have to constantly query for the state of the input pin to see if it's been pressed, we'll set up the pin as a counter. When the button is pressed, the pin's public data buffer will increment. That way the host can detect all button presses which have happened. We'll also use the Wombat's ability to debounce the incoming signal, in order to prevent a single noisy press from being counted multiple times. The switch is tied to pin 38 and ground. Again, we don't need a pull-up, since the internals are enabled for pins 33 to 40.

The rest of the circuit is the same as the demo in Getting Started

The Application

You can download this application, its source, an installer, and this documentation in a zip file.

This application has only been tested on Windows XP with iTunes version 6.0.4.2. You may need to download the .Net 2.0 framework from Microsoft to get this app to run.

When you launch the App, it will appear as a Wombat icon in your system tray. Right click it and open the Serial Port attached to the Wombat. Note that you must power cycle the Wombat in order to change baud rates if you're using Autobaud (the default when shipped).

Basically, it's real simple. Launch iTunes, and select a playlist or library. Launch the app, and connect to a Wombat. Your currently playing song will appear on the LCD. You can adjust volume with the pot, the playing song with the rotary encoder, and pause and play via the button.

If you don't have a particular piece of hardware (for example the rotary encoder) the remainder of the functions (such as the LCD) will still work.

 

 

Copyright Wombat Interface Products, 2005-2008. All Rights Reserved.