External device input - interface

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#

Related

Implementation of USB device driver on my own OS based in Linux

I’m on process of developing my own Operating System based in Linux.
This week we’re aiming to implement very simple USB device driver , which is quite hard to get basic algorithm .
However commonly it’s hard to find out some sources aside from commercial linux system.
And I want to get some advice about this .
Plus, I do all these stuffs on Ubuntu , using QEMU emulator.
I’ve done simple file system and hard disk device driver so far.
Help me out how to implement USB device driver with very sime ideas.
Thank you !! :)
Implementing USB is quite the task. First you must have a working PCI(e) enumerator or other form of finding the USB controller. You then must find out which of the four most common controller types it happens to be. Each controller type is completely different from the previous and must contain its own driver. You also need a standard USB interface that is independent of the controller type.
Taking on the USB is quite the task, but in my opinion a very interesting and enjoyable task. Enjoyable enough, that I even wrote a book about how to do it. It explains how to find the controller(s) via the PCI(e) bus, how to setup this bus, how to detect the type of USB controller--UHCI, OHCI, EHCI, or xHCI--and how to send and receive data packets to/from attached devices. This book was written exactly for the purpose of those of us creating our own operating systems and adding USB support to them. The fact that you are basing your OS on Linux should not matter since the book does not rely upon any existing OS to accomplish this task, other than the example programs relying on memory allocation, which is easily modified for your developing platform.
Might I say that if you do take on this task, it will be a difficult task, but it will be an enjoyable task. In my opinion, the USB is the most enjoyable part of this hobby of ours.

Controling Pc Mouse from Gryoscope/Accelormeter

I have build an IMU consisting of an Accelerometer and Gyroscope that can provide 6DOF motion output results to pc. I use a serial COM port over USB interface to get data on pc and i can see the data through Hyper terminal.
Now what i want to do is control my mouse pointer with that data for demonstration purposes. I initially looked at GlovePIe application but it doesn't support serial com ports. So it would be great if anybody could advice or direct me to a possible solution.
I am doing something similar, controlling pc mouse with android phone. But I am using Bluetooth and the touchscreen as input. You can look into win32 api functions for controlling com port.
You can also you sockets to send coords over tcp/ip. Setting up Bluetooth/Sockets is fairly easy once you understand the api calls. Let me know if you need more assistance.
use C++ code to controll the pointer location. SetCursorpos(x,y).Enjoy

Using iPhone as control device (game controller type) in Windows

Is there a way to use the iPhone as an interface device for a computer without actually having to code a driver? Being the owner of a sub-par game controller and realizing that it would be cheap and a good experience to try to roll my own, I have no idea where to begin on the PC side. I am capable of processing accelerometer and touch events on the iPhone and sending them over a network, but where would I begin on the Windows side? I'd prefer to not get as low level as a driver, but I want to be able to use the accelerometer as an analog input device and buttons on the screen as regular buttons. How should I go about this? If I have to write a driver, what would be a good reference/code sample to start with?
You don't need to write drivers as long as you handle the data being sent by the iPhone on PC. As far as where to begin on PC side, all you need to do is create a small program which listens for data on the socket. You can make that program in any language C, C++, Java etc. I had worked on a similar application as mentioned by you. On PC I used Java with Visual Studio IDE.
I believe this is similar to what Splashtop's Remote does (http://www.splashtop.com/remote/touchpad). They seem to use a network connection to accomplish this goal.
Also Joypad, same concept (http://getjoypad.com/).

(non-touch) iPhone gesture recognition

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.

Wireless communication: AVR based embedded system and iPhone

What is the best way to realize wireless communication between an embedded system (based on an AVR controller) and the iPhone? I think there are only two options: either WiFi or BlueTooth. The range is not really a problem, since both devices should stay in the same room.
I have no idea, if there are any useful WiFi boards that can be connected to an AVR based microcontroller system (or any small microcontroller), any hints would be highly welcome.
I guess the better solution would be BlueTooth, but there is also the problem: which BlueTooth board is best suited for attachment to an AVR system, and is it possible to use the iPhone BlueTooth stack for (serial) communication over BlueTooth with the AVR device.
I hope that somebody already realized such a system and can give some helpful tips...
You can get modules for both WiFi and Bluetooth that will connect to an embedded system through a UART interface, however a WiFi module will have far more processing power than your AVR microcontroller, often with spare capacity and I/O to execute additional user code, so connecting one to an AVR maybe somewhat redundant in many cases.
Bluetooth modules are simpler, less expensive, and the data-rate is better matched to the AVR's capabilities. For example these Parani modules. I have used them between an embedded system and a Laptop PC's Bluetooth, so given appropriate communications software, there is no technical reason why it could not be used with an iPhone I think. However this may be the flaw, on the PC the device was recognised as a virtual serial port, I don't know whether iPhone supports 'legacy' communications in quite the same way.
For comparison, a WiFi solution
From what I know, BlueTooth is very limited on the iPhone: There is only very few BlueTooth-Profiles implemented, and - even if they can be extended with a jailbroken iPhone - I doubt this is easy to use from the application layer.
On the other side, transferring via WiFi requires a lot of processing power and memory since much more things have to be implemented before you can even start transferring data: 802.11, cdma/ca, arp, tcp. That's a big task.
Is it an option to build a hardware extension to the iPhone ? You might be able to get the serial connection and power out of the dock connector. Then even ZigBee could be very helpful.
Here's an article you might find helpful. I would lean toward a WiFi solution just because of the added flexibility available.
http://www.embedded.com/design/networking/215801088
-t
Some of the other people at the office have done AVR <- Bluetooth -> Symbian and AVR <- Bluetooth -> PC solutions without trouble. There is lots of info, reference designs and source available. I have no idea of how hard it would be to use Bluetooth on Iphone.
The exact module is probability also not important as long as it got some type of serial interface (I2C,SPI) to interface to the AVR and some source code show how to use the module.
Is it an 8-bit or 32-bit AVR? For the AVR32 processors there's support
for WiFi in the Atmel 1.5.0 Software Framework using SD-card-mounted
WiFi modules from HD Wireless (http://www.hd-wireless.se), including
an IP stack (lwIP). Be aware that you need Ad-Hoc (IBSS) support to
connect directly to the iPhone.
There is WiSnap kit. It can connect directly to a standard RS232 interface or through the TTL UART interface to embedded processors. We are planning to use it in our project. It also has Ad-Hoc support.
There are some usage examples and an iPhone application for connection setup.
http://serialio.com/products/mobile/wifi/WiSnapKit1.php
What are you trying to communicate between your AVR and the Iphone? The Iphone is made for the web along with everything apple (which AVR's are decidedly not). So what works well is an embedded device that exposes a web-interface. Like the Transmission bittorrent client on Linux. Also nowadays many low-power small form-factor linux platforms exist that will allow you to do this.
For instance Gumstix has an ARM based platform that runs linux and includes WiFi (Overo Fire).