(non-touch) iPhone gesture recognition - iphone

I am about to start on a huge new project which will rely on the use of an Arduino connected to third party electronics (in this case an electromyography board I have already built).
I have a good idea of how to transmit data between the Arduino and the iPhone or iPad using protocols like OSC and an Ethernet shield.
What I am hoping to achieve is to effectively analyse an incoming analog signal and recognise the gestures employed to create that signal. So what I am essentially talking about is waveform analysis, whether it is on the iPhone side or on the Arduino side. Are there any libraries or previous methods of analysing or recognising gestures? This is going to be a large research project, so I am really looking for a push in the right direction.
This, I understand, might be a vague question so if anybody wants me to shed some light on the matter I will be more than happy.

Related

Control Camera desktop application using Gyroscope of Android smartphone

For a project at my university I need to create a Unity3D application on my laptop, in which the camera is stationairy and can be controlled to rotate in any direction using the gyroscope of my Android smartphone (Nexus 5), wirelessly or through usbcable.
I've looked at the possibility of OSC or the Unity Remote 5 App, but up till now haven't found a way that works in order to obtain this result.
Any help or advice would be hugely appreciated - I don't have much experience yet with all this.
Thanks!
If i was going to do this then I would use UNET (Unitys built in multiplayer networking API) and have the rotation sync over LAN.
On the camera I would have a Network Transform and a script to control its rotation based on accelerometer input.
The version on the phone would be the authority and sync it's rotation over the network to the client on the laptop.
Pros: Wireless, fast (over wifi), very little code required to make it work, lots of documentation available online.
Cons: Relies totally on your network situation, you will have to do a lot of trial and error to get a smooth experience (not jerky) i think.
As for getting the tilt input on the device, Unity have a great tutorial here: https://unity3d.com/learn/tutorials/topics/mobile-touch/accelerometer-input
It's pretty straight forward.
Sound like a fun project, good luck!
It's possible to do this via cable, WiFi, Bluetooth 2.0 or Bluetooth 4.0 (BLE). I have implemented what you need in WiFi and Bluetooth 2.0 for my current work.
It's pretty easy to get rotation values and stream them from Android but I don't think you will need to do anything because you can just use this!
https://play.google.com/store/apps/details?id=de.lorenz_fenster.sensorstreamgps&hl=en
So the question is how do you receive the data this is sending on Unity's side. The answer is the UdpClient class.
If you need more reliability because every second student in your uni library is torrenting Mr. Robot and your getting huge lag then I can tell you how to implement the same thing in Bluetooth, which is not super trivial as .NET 2.0 (which unity uses) doesn't support bluetooth libraries, but there are solutions...

External device input

I am looking into what's the best method for getting external data (custom built hardware) and to intercept and process this data (programming language / tool), the cheapest and easiest and with the least learning curve.
Background:
I am a web dev.
External device will be switches, motion detection, velocity detection
Programming language: Delphy (which I don't know)? or C# (which I know for web dev) or other?
Anyone done anything like this before? Got any advice?
Any and all information is appreciated.
D
The easiest solution might be to use an Arduino.
It's :
cheap (~ 30$)
easy to program
easy to connect to your PC (it use an USB cable which emulate a serial connection)
have a HUGE community with tons of tutorials for doing whatever you want
Here is an example how to control a led using C#

Using iPhone serial connection (pins 12 and 13)

Ok, so I've never done anything with serial connections before. But...
I just got an Arduino that I am trying to use to remotely launch model rockets. I have a 5 volt relay that I can control with the Arduino's digital out.
Now, I want connect my iPhone's Tx to the Arduino's Rx and vice-versa. I would buy the iPhone breakout board from spark fun so I could connect it to the Arduino. (http://www.sparkfun.com/products/10645) I was thinking something along the lines of: when the phone gets a text or a call from a certain number, or maybe even just a bluetooth signal, it would tell the Arduino. But those are just ideas.
How can I actually send a signal from my iPhone? Are there xCode libraries to do this? My phone is jailbroken, so I am open to other non-apple ways for sending signals. But I am a novice programmer.
Thank you.
P.S. I'm new to Stack Overflow, and I would appreciate if you could help me. The first time I posted a question someone told me it wasn't on the right site. So please bear with me.
EDIT #1: Haha, I just read over this and it sounds like a cell phone bomb from a terrorist movie. I swear that's not what I'm doing. Just look at my avatar.
EDIT #2: I also have a Bluetooth dongle for the Arduino. But I honestly have no idea how to interface that with anything, it was $10 from China, so I thought I would buy it to keep my options open. But, regardless, it would be really cool to plug an iPhone into an Arduino.
You could buy a Redpark Serial Cable for iOS to connect the iPhone to your Arduino board over RS-232.
This book also seems to be helpful: iOS Sensor Apps with Arduino
EDIT:
Redpark FAQ: http://redpark.com/c2db9_FAQs.html
There is a SDK available for this serial cable.
You will have trouble writing communication software when trying to connect directly to the dock connector! The External Accessory Framework wont help you here unless your Arduino board has a special decoding chip for dock connector communication.
Have fun!
All I think you need to do is utilize the External Accessory framework. I'm not sure how well it will work for you, the library is meant to communicate with MFi approved accessories. I'd really like to hear how your results went, I am going to be conducting an experiment of my own using a break out board
I am in a similar boat as you, and I have successfully built my own serial cable using the podbreakout, and have implemented a serial class that supports reading / writing. I can confirm that I have read working, as I have tested it with my RFID reader. I am in the process of writing code that will send a command to the Arduino from the iPhone, and then have the Arduino perform a task based on the command.
Here is a document I put together on iDevice serial com,
https://docs.google.com/document/d/1Yi9_hcw8XSyYNCG2OJT9oHlTG-dC-Dnuc58VIULa81Q/edit?usp=sharing
and the serial class can be seen in the project I am working on.
https://github.com/ipatch/KegCop

Use external clickwheel hardware in iOs app

Intro: I have a Denon S-52 internet radio with an iPod/iPhone dock (the older 12V kind, so charging is not possible with newer devices but audio/control data is passed through). The radio has an external clickwheel-like control that worked beautifully with iPod nano/classic etc. Since the iPhone/iPod touch no longer have any clickwheel functionality, the signals from the Denon clickwheel no longer have any effect while playing (ie no seeking), but can navigate through some menus on iOS, and play/pause works. The few clickwheel apps I've tried obviously ignore the external signals.
Questions: How hard would it be for someone with no iOs programming experience (just C/C++/C#, plus an objective C tutorial from lynda.com) to develop a basic audio player app that would accept signals from the external Denon clickwheel to seek within an audio file (for my own use, at least at first)? I'm assuming this is possible because the signals are sometimes processed (as mentioned above), but I'd be happy to be proven wrong before I waste a lot of time and effort. I also assume a standard $99 iOS developer membership would be enough (since the device itself is already MFi)? Or perhaps an app that has this feature already exists?
How hard would it be for someone with no iOs programming experience (just C/C++/C#, plus an objective C tutorial from lynda.com) to develop a basic audio player app that would accept signals from the external Denon clickwheel to seek within an audio file (for my own use, at least at first)?
Nearly impossible. It's not just the challenge of figuring out how to access the dock connector and interpret the signals of interest. The real problem is that you want to use those signals to control music that's playing, and you're probably thinking of trying to control the iPod application rather than writing your own music player. Communicating between two apps is difficult at best, and probably not possible if the target app (iPod) doesn't provide a mechanism for external control. And the fact that you're new to the platform doesn't make any of this easier.
Your best hope is probably to file a bug with Apple requesting this feature and hope that they'll add it for you.
I was able to do this by jailbreaking my iOS device, which enabled me to access the serial port for iPod Access Protocol communication at /dev/tty.iap. Then I could incorporate something like the functions found in this iPhone Serial Port Tutorial (check archive.org if the link no longer works) to read the incoming signals and respond accordingly.
Update: An even better solution seems to be to write a tweak hooking into the iPodUI private framework and intercept the commands directly, and then message the Music player about what to do (see this post for more details).

question about how to flicker led in ipad iphone using connector

Experts, I want to develop an app (with accompanying hardware) that turns 2 leds (Light Emitting Diodes), in different frequencies, I found this pin out for the iphone/ipad connector
link.
The questions are:
what pin should be the best to accomplish my flickering led? pin#? and and (GND off course),
what function in objective C will allow me to do this?,
I found this site for buying the connectors, do you have a better one?
I intend to have the earphones connected as well, so the sound pins are not an option,
thank you in advance!
edit>
here an example of an
external flash light for the iphone
light
so I ask you guys please the same question, what pin and what function is used to turn this light on?, I can take care of the frequencie generation and the electronics, thanks!
The ExternalAccessory.framework is the best place to start. It's covered in the External Accessory Programming Topics.
Manufacturers must build explicit
support into their accessory hardware
for communicating with iOS. As part of
this support, an accessory must
support at least one command protocol,
which is a custom scheme for sending
data back and forth between the
accessory and an attached application.
Apple does not maintain a registry of
protocols; it is up to the
manufacturer to decide which protocols
to support and whether to use custom
protocols or standard protocols
supported by other manufacturers.
It's basically all up to you to create the protocol but the ExternalAccessory.framework is where iOS meets the external device.
Original answer, which would sound snarky to an electronics engineer, removed. :-)