Вопрос

I am building an assistive iOS app for a kid that uses a switch to control his computer (a simple button that can send only one massege to the computer).

I am looking for a way to connect my app to a switch that can send click events to my app. It can through by BT, IR or even through the earphone connection (headset port).

(BTW he can not use the iOS screen as the switch).

Any ideas ?

Это было полезно?

Решение

A BT connection requires you to be a certified MFi developer, and that requires money and a real company.

The headphone port would be a great place to interface with. You could wire a simple switch over the microphone line and ground line which, I think, would create a square wave duty cycle for on and off. I've done something similar where we used the headphone port to communicate to a microcontroller through a sound wave that was then converted to 16 bit packets and used to control additional hardware and also give feedback from that hardware.

Another option is a wifi connection, an arduino with a wifi shield and the button on that.

Edit: The more I think about it, the more I would say use the headphone port. It will be super cheap, the programming to detect the presses will be really easy, and this will probably be the fastest way to achieve your solution. Provided you can solder.

Другие советы

I'm going to suggest going down a different path. Instead of trying to connect the switch directly to the iPhone, use something like an Arduino board with both physical switch and ethernet I/O ports plugged into the local network, and create what amounts to a physical I/O server.

The Arduino handles the physical interfacing and your iPhone app only has to handle the communications protocol to the Arduino over Wi-Fi.

One inexpensive solution would be to use the mic or mic input on the headset port. Connect the switch up to some sort of tone generator (555 timer or Arduino, plus piezo speaker or headset cable). Have the app run an input Audio Queue, and pass the Audio Queue input buffers to a DSP narrow band filter or an FFT. Monitor the frequency band of the tone generator for any significant energy burst above the background noise level. Potentially use multiple separate tone frequencies for more than one switch.

Added: Another simple alternative might be to use the switch to activate a solenoid or small motor (scavenged from an old motorized toy or similar) to tap a capacitive pen or ball of conductive foam on the iPod Touch display. No MFi, WIFI or audio DSP coding required.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top