hiduino (arduino as usb midi device) and iOS
Moderators: adafruit_support_bill, adafruit

hiduino (arduino as usb midi device) and iOS

by braingram on Fri Jan 06, 2012 11:26 am

I'm working on building a scientific measurement device for teaching using an arduino and an iPad. The general overview is:
1) Arduino reads sensor values (possibly from Vernier probes)
2) Arduino transmits data to iPad using usb-midi
3) iPad displays sensor data

I was able to install the hiduino firmware on the 8u2 to allow the arduino to show up as a usb-midi device and confirmed that it could send midi events to a linux computer using gmidimonitor and alsa command line tools. However, I'm running into problems using iOS.

I installed midimonitor on ios and connected the arduino using the camera connector. When I start up midimonitor the devices section says loading, briefly shows the hiduino available, displays a few midi notes (I'm using the first hiduino example sketch) and then crashes.

Has anyone experienced this problem before (midimonitor crashing using hiduino)?

It seems like a neat way to connect an arduino to an ipad and I would very much like any input on the project.
braingram
 
Posts: 4
Joined: Fri Jan 06, 2012 11:16 am

Re: hiduino (arduino as usb midi device) and iOS

by braingram on Fri Jan 06, 2012 12:01 pm

Oops, going to sort of answer my own question here.

I was fiddling around a bit more and tried the 3rd hiduino example that wasn't sending notes as fast. Also, I powered the arduino off the iPad (I was using external power before) and midimonitor didn't crash!

It's nice to see the iPad displaying arduino sent midi values. The next step is to write a sketch for the arduino to read in sensor values and send them over midi. I have grand plans for a generic firmware that would enable as much of the arduino as possible, but I'm going to start simple.
braingram
 
Posts: 4
Joined: Fri Jan 06, 2012 11:16 am

Re: hiduino (arduino as usb midi device) and iOS

by adafruit on Fri Jan 06, 2012 9:10 pm

interesting! do you have a example code/photo to show? I think people would like this!
User avatar
adafruit
 
Posts: 11717
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: hiduino (arduino as usb midi device) and iOS

by braingram on Mon Jan 09, 2012 12:32 pm

I've made a bit of progress and will hopefully have pictures and code to show within the next few days. I'm working on a first-pass of a Vernier sensor library at the moment. More to come soon!
braingram
 
Posts: 4
Joined: Fri Jan 06, 2012 11:16 am

Re: hiduino (arduino as usb midi device) and iOS

by braingram on Wed Jan 11, 2012 10:03 am

Looks like there is some wider interest in some parts of this project:
http://www.adafruit.com/blog/2012/01/11 ... e-arduino/

I'll duplicate what I put in my comment.

My progress so far is on github:
https://github.com/braingram/midi_sensor_platform

The final goal is to make these vernier-arduino-ipad (VAI?)sensor platforms for a classroom of grade school kids (who already have ipads) to discover that the world is more than screens, pictures and text.

So far I have software for using the analog (BTA) vernier sensors (with auto-id using the resistive coding on the sensors) and am planning to work on the digital sensors if I can find documentation and a few sensors to test things out.

Some brief details on the system at the moment:
1) sensor values are reported over usb-midi as pitch-bend events (so we can at least get the full 10 bits from the arduino a2d)
2) connecting or disconnecting an auto-id sensor triggers the arduino to send a CC command with the new sensor ID
3) a change in sensor value is only reported if it exceeds a certain threshold (so the midi bus is not flooded), this threshold can be controlled by sending the arduino a CC command
4) if a non-auto-id sensor is connected it will NOT cause the arduino to start sending sensor data, instead a CC command must be sent from the host to the arduino to tell the arduino to enable that sensor

I'll also add this stuff to the github readme.

Hopefully more to come soon!
braingram
 
Posts: 4
Joined: Fri Jan 06, 2012 11:16 am