PDA

View Full Version : Tilt Sensor Not-Quite-SDK


barclay
3rd July 2008, 01:44 AM
I contacted HTC and asked them if they had a tilt sensor SDK, or had plans to release one, and they basically said "no". So, I decided to see what I could come up with to get tilt response integrated into my little pet-project, and to my surprise, managed to figure out how to get some basic data out of the existing tilt sensor DLL on the Diamond.

If you'd like, you can see my "hello world"-level app using the tilt sensor here on my blog (http://scottandmichelle.net/scott/comments.html?entry=784). I've included the source so others can play with the few tidbits I've figured out. The app itself is pretty boring, it'll really only be of interest to developers looking to integrate tilt into their app, and even then, it's still a boring app =)

If accessing the tilt sensor is well known, feel free to ignore me.

someone1234
3rd July 2008, 01:53 AM
Well done, thats great!

You should also probably look at this and talk to CharlyV, he might be able to add some info.

http://forum.xda-developers.com/showthread.php?t=403939

Magic_Knight
3rd July 2008, 11:14 AM
That's great news !
Now developers might use such information to release usefull applications and funny games !

Riel
3rd July 2008, 11:18 AM
Yes, I was wondering, for my car I use the G-tech for acceleration-measurement.

Is this sensor sensitive / good enough to also do those kind of things?

Also, navigation programs can be a lot more precise by knowing when accelerating, cornering or braking.

barclay
3rd July 2008, 04:58 PM
Yes, I was wondering, for my car I use the G-tech for acceleration-measurement.

Is this sensor sensitive / good enough to also do those kind of things?

Good question: I might try to write some sort of logging program and see what kind of data I can get out of a car trip. That's a bit off for now.

Also, I made a minor update the project, I determined a few more of the unknown values that the API returns.

laporte
5th July 2008, 07:40 PM
perhaps you or some other guys are capable to work with some tools mentioned in this post??

http://forum.xda-developers.com/showpost.php?p=2373447&postcount=56

Hennes19
5th July 2008, 07:52 PM
Is there any chance to develop a calibration tool for this sensor?? Mine drifts to lower-left and thats annoying because Opera always means, I rotate my phone :-(

Thank you

barclay
6th July 2008, 06:53 AM
I updated the project to include a sample of how to use the event driven notification of different orientations that Opera uses (instead of polling the sensor constantly to determine the current orientation).

I'll have to do some digging to see if there's any way to calibrate the sensor. It'd be nice (mine is a bit off too), but I don't see anything immediatly obvious.

crazy cat
6th July 2008, 08:21 AM
Perfect news!
I hope there are devs, who will make apps or games for this. My idea of a new game is "Black Circle".
(Side in German bug game in English, dont worry)
http://spiele.isnichwahr.de/r432-spin-the-black-circle.html

What do you tink about it?

Koush
7th July 2008, 09:18 AM
I wrote a managed wrapper based on Scott's work:
http://blog.enterprisemobile.com/2008/07/using-htc-diamonds-sensor-sdk-from-managed-code/

Koush
7th July 2008, 09:23 AM
I think it would be possible to calibrate the sensor by replacing the HTCSensorSDK.dll with one that acts as a pass through to the real thing. Then it could "massage" the returned values with calibration adjustments.

Teeter -> HTCSensorSDK.dll (one we roll that tweaks values) -> RealHTCSensorSDK.dll (the real DLL)

I don't think that the DLL is replaceable unless the device is flashed with a new ROM.

Thoughts?