Jump to content

The HTC Touch Diamond accelerometer... wide open


Guest PaulOBrien

Recommended Posts

Guest Paul (MVP)

Looking to implement support for the HTC Diamond accelerator in your native or managed applications? Now you can!

The breakthrough is thanks to Scott Seligman at ScottAndMichelle.net...

I spent a couple of sleepless hours last night writing a little Sensor Test for my new HTC Diamond. It's a small app that lets you move a circle around the screen by tilting the device.

Exciting, eh? Well, the fun is in getting it to work. I asked HTC if they provide a development kit (SDK) for the tilt sensor, and they said "No", so I had to figure it out myself by digging around (and trying to remember what I knew of ARM assembly). I'm just happy I managed to figure it out, and so others can write interesting games with it, I'm giving the source code to what I figured out away. Have fun, create something with it.

You can download Sensor Test here, it's the small app I describe, along with the project necessary to compile it. You'll need Visual Studio 2008 and the WM 6.0 SDK to compile it yourself, though if you're a Windows Mobile developer, I suspect you'll only need to see the top of the main code file and the first couple of functions to figure things out.

I'm going to work on a little game idea I have, but with the way I bounce from one project to the next, don't be surprised if it takes me a while.

...

I've added some code to show how to get notifications in an event-driven model from the tilt-sensor on the diamond to my Sensor Test project. The amount of information you can get out of this is very limited, only the current side of the device that's "up", but it's useful for some apps. For instance, this is what Opera uses on the device to sense when it needs rotation without reverting to polling the tilt sensor a few times a second

If you're a native developer, Scott's page is probably the place you want to start to implement accelerometer support in your own application. If - like me - you are a developer in nice fluffy managed code land then do not despair, Koushik Dutta has created a managed wrapper for Scott's work! The wrapper exposes some very intuitive methods, as well as an event driven framework for when the device's orientation changes... SWEET!

You can find Koushik's work here.

I'm definitely looking forward to seeing cool applications hitting the streets using these libraries, and i'm definitely trying to think how to support into my own projects! :D

P

[Via: wmpoweruser]

Link to comment
Share on other sites

Guest l3v5y

I sent an email to HTC about the SDK, they haven't replied yet (I sent it over a week ago), but someone has made progress!

:D

Now to try and add this to FSD, my only real program...

Link to comment
Share on other sites

  • 4 months later...
Guest Nick Brunch

I wrote this software which uses the HTC diamond's accelerometer and light sensor. Check this out : http://nishantpant.wordpress.com/2008/11/1...-touch-diamond/

Looking to implement support for the HTC Diamond accelerator in your native or managed applications? Now you can!

The breakthrough is thanks to Scott Seligman at ScottAndMichelle.net...

If you're a native developer, Scott's page is probably the place you want to start to implement accelerometer support in your own application. If - like me - you are a developer in nice fluffy managed code land then do not despair, Koushik Dutta has created a managed wrapper for Scott's work! The wrapper exposes some very intuitive methods, as well as an event driven framework for when the device's orientation changes... SWEET!

You can find Koushik's work here.

I'm definitely looking forward to seeing cool applications hitting the streets using these libraries, and i'm definitely trying to think how to support into my own projects! B)

P

[Via: wmpoweruser]

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.