Minimum Requirements:
PC running Windows XP or newer.
A Wi-Fi connection to your PC.
An iPod Touch or iPhone. I used a iPod Touch 4G.
You do not need programming experience for this instructable; however, if you want to create your own screens, or write your own code for the PC host, you will need to have some experience in network programming with UDP datagrams, and some javascript programming experience. I provide all the source code for this instructable (see step #6).
Step 1: Install Control from iTunes
http://itunes.apple.com/us/app/control-osc-midi/id413224747?mt=8
Step 2: Run the App
Tap “+” to add the OnOff control. Enter the URL:
http://home.cogeco.ca/~mybrainhurts/onoff.js
This is the source code for the screen. It describes the shape, colour, and operation of the buttons. It is written in JSON, a subset of Javascript. Once it is loaded on your iPod, you don't need to reload it.
Note the last entry on the “Interfaces” screen is now “OnOff”. I've found it is hard to navigate to new menu items. If you have trouble, simply stop Control and restart it.
Step 3: Run the PC host program
http://home.cogeco.ca/~mybrainhurts/onoff.zip
Extract the onoff.exe file from the zip and run it. Click the Start button. The program will tell you the IP of your PC.
On your iPod Touch, select “Destinations” from the menu. Tap “+” and enter your PC's IP in the “Enter Destination URL” (just the IP, no “http://”). Enter 10000 as the port number, then tap “Add”. Your IP address and port will appear in the list. Select it and it will turn grey.
Select “Preferences” from the iPod Touch menu. Enter 10000 for the OSC Receive Port.
Your iPod Touch is now ready to communicate to your PC.
NOTE: Every time you start Control, you will have to select your URL from the “Destinations” screen.
Step 4: Run the iPod Control Screen
At this point, you are now communicating in both directions. The iPod Touch sent the value of the ON command as 127. The PC received the datagram, detected the originating IP, and begins updating the iPod Touch at 2Hz with the current value.
Press the OFF button on the iPod and it will change the state on the PC and on the iPod Touch.
Click the radio button on the PC’s dialog box and the iPod Touch buttons will change state.
The loop on the PC runs at 500ms, so don’t be harsh about the update speed.
Step 5: Bonus Step: Control Something
The relay I used is a Crydom D1240, which I had in my junk pile. I see they are available from Digi-Key for about $40 US.
If you don't have anything like this, then try turning on and off a LED.
Step 6: What Next?
http://charlie-roberts.com/Control/interfaces/
Use a text editor (notepad or write) to experiment. Be sure to have the documentation for the widgets open in a browser window for reference. http://charlie-roberts.com/Control/?cat=4
The zip file you downloaded contains the C++ code (Visual Studio 6) for OnOff.
The zip file also contains JSON and C++ programs for analog controls using a slider. There is also a LabView 2009 implementation of OnOff .
The communications between Control and the host uses the OSC (Open Sound Control) protocol. For more information on the message formats, see http://opensoundcontrol.org/spec-1_0










































Visit Our Store »
Go Pro Today »




i have been trying this experiment on my iphone 3gs but my onoff.exe file which i dowloaded says "couldnt bind" when i click on START
Have a look at my ibles as well!