Tilt Sensor Not-Quite-SDK - Touch Diamond, MDA Compact IV General

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. 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.

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

That's great news !
Now developers might use such information to release usefull applications and funny games !

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.

Riel said:
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?
Click to expand...
Click to collapse
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.

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

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

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.

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?

I wrote a managed wrapper based on Scott's work:
http://blog.enterprisemobile.com/2008/07/using-htc-diamonds-sensor-sdk-from-managed-code/

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?

Related

Enough brain power to rival a nuclear reactor

But yet with all the talent on this board...
We can't figure out how to get the damn keyboard light to stay on longer than 5 seconds (8125)... Errrrrrrr
Just my rant! Thanks for stopping by.
5 secs is more then enough for me, if I dont type, I dont need the keyboard light on...and when I start typing, it goes on again....no problem at all
I did some work on this, but without a Wizard I can't test any ideas out.
For anyone interested or with a fusion powered brain, have a look through the battery driver. That's where this is effected on the Universal.
V
Keyboard light
Yeah - I am not a geek, just a user. Having said that, I simply keep my left thumb on the "dot" key and tap it if I need the light. Do I have to say that I tap it again when I want to type a non-special key?
I understand the light is a creature comfort, but, sheesh, the machine is already soooo awesome, this seems like a very trivial complaint.
IMHO
TR
vijay555 said:
I did some work on this, but without a Wizard I can't test any ideas out.
For anyone interested or with a fusion powered brain, have a look through the battery driver. That's where this is effected on the Universal.
V
Click to expand...
Click to collapse
If you need a beta tester for a work around for this let me know. I can load it up and let you know if it works.
something to try
There is a backlight hack in the Univelsal wiki forum Try to do that
wiki.xda-developers.com
vijay555 said:
I did some work on this, but without a Wizard I can't test any ideas out.
For anyone interested or with a fusion powered brain, have a look through the battery driver. That's where this is effected on the Universal.
V
Click to expand...
Click to collapse
Howdy Vj -
I was going to start poking around the Wiz driver soon. Can you point me to any forum posts I can reference on the relevant locations within the Uni driver?
summiter - hi! I spent quite a while disassembling the Universal stuff, because we know that does use the reg key
HKEY_CURRENT_USER\ControlPanel\Backlight\QKeyLedTimeout
to control backlight time.
I traced this back to the battery driver, which also has some other useful stuff. Then I think I got bored, but you can check the Wizard driver to see if it has an equivalent. Otherwise I tried to hook directly into the driver to activate the backlight directly with an IOCTL, but not successful at the time. It doesn't export a function directly to activate the backlight I think.
I did try and it did not work, simulating a keypress, modifying the input queue, and various techniques for spoofing keyboard input, but the backlight is activated by the driver at a hardware level, not because of spoofed keyboard presses. So I think best way is to reverse engineer the driver and hack into the backlight there... but I moved on to other things first...
V
vijay555 said:
summiter - hi! I spent quite a while disassembling the Universal stuff, because we know that does use the reg key
HKEY_CURRENT_USER\ControlPanel\Backlight\QKeyLedTimeout
to control backlight time.
I traced this back to the battery driver, which also has some other useful stuff. Then I think I got bored, but you can check the Wizard driver to see if it has an equivalent. Otherwise I tried to hook directly into the driver to activate the backlight directly with an IOCTL, but not successful at the time. It doesn't export a function directly to activate the backlight I think.
I did try and it did not work, simulating a keypress, modifying the input queue, and various techniques for spoofing keyboard input, but the backlight is activated by the driver at a hardware level, not because of spoofed keyboard presses. So I think best way is to reverse engineer the driver and hack into the backlight there... but I moved on to other things first...
V
Click to expand...
Click to collapse
Wow.... Like I said lots of brain power, and yet the solution to a simple task eludes even the most bright...
As for all current reg hacks none of the work on the 8125.
DXL007: don't know if that's a complement or an insult, but I have to choose my battles: as the famous quote says, this type of stuff is "99% perspiration and 1% inspiration"... I had to do quite a lot of reversing just to get to an educated point of failure Then I just play call of duty until I'm ready to do the next one! And I'm working on several new, unrelated apps first.
But as I said, I don't have a Wizard, and there are a lot of other guys on the board capable of this! But I'll try to have another look when I get time... I tend to drift between projects subject to time.
V
DXL007 said:
vijay555 said:
summiter - hi! I spent quite a while disassembling the Universal stuff, because we know that does use the reg key
HKEY_CURRENT_USER\ControlPanel\Backlight\QKeyLedTimeout
to control backlight time.
I traced this back to the battery driver, which also has some other useful stuff. Then I think I got bored, but you can check the Wizard driver to see if it has an equivalent. Otherwise I tried to hook directly into the driver to activate the backlight directly with an IOCTL, but not successful at the time. It doesn't export a function directly to activate the backlight I think.
I did try and it did not work, simulating a keypress, modifying the input queue, and various techniques for spoofing keyboard input, but the backlight is activated by the driver at a hardware level, not because of spoofed keyboard presses. So I think best way is to reverse engineer the driver and hack into the backlight there... but I moved on to other things first...
V
Click to expand...
Click to collapse
Wow.... Like I said lots of brain power, and yet the solution to a simple task eludes even the most bright...
As for all current reg hacks none of the work on the 8125.
Click to expand...
Click to collapse
VJ handled your message quite gentlemanly. I on the other hand think you should take your sense of entitlement elsewhere.
vijay555 and summiter,
I hope DXL007 meant this more as encouregment than it came across, but I hope you guys realize that the vast majority of the people on this forum appreciate what you do for us and don't feel it's something you owe us. There aren't many people that can and will provide such useful software and information and not expect an arm and a leg for it. Mainly because of the two of you my 8125 is the perfect pda and keeps getting better.
Thanks,
Mike H
summiter said:
DXL007 said:
vijay555 said:
summiter - hi! I spent quite a while disassembling the Universal stuff, because we know that does use the reg key
HKEY_CURRENT_USER\ControlPanel\Backlight\QKeyLedTimeout
to control backlight time.
I traced this back to the battery driver, which also has some other useful stuff. Then I think I got bored, but you can check the Wizard driver to see if it has an equivalent. Otherwise I tried to hook directly into the driver to activate the backlight directly with an IOCTL, but not successful at the time. It doesn't export a function directly to activate the backlight I think.
I did try and it did not work, simulating a keypress, modifying the input queue, and various techniques for spoofing keyboard input, but the backlight is activated by the driver at a hardware level, not because of spoofed keyboard presses. So I think best way is to reverse engineer the driver and hack into the backlight there... but I moved on to other things first...
V
Click to expand...
Click to collapse
Wow.... Like I said lots of brain power, and yet the solution to a simple task eludes even the most bright...
As for all current reg hacks none of the work on the 8125.
Click to expand...
Click to collapse
VJ handled your message quite gentlemanly. I on the other hand think you should take your sense of entitlement elsewhere.
Click to expand...
Click to collapse
LOL...I always like messages like this. Yeah, it's a simple task so it must be that these "experts" are all lazy and liars. Takes me back to the old days (yesterday?) when a Pocket PC could do anything a laptop could do but the evil Microsoft hid all the features in the registry. Yep, whatever you say and good luck with that. :lol:

Establish standard for G-Sensor calibration

Here is an idea: a lot of people are unhappy about the fact that their G-Sensor is out of alignment, and that this may negatively affect apps which may be developed in the future (or which are already under developemnt) and which rely on the sensor for something critical. Though my device does not suffer from this, I can fully understand them!
However, today the only app which uses the sensor is Teeter, for which - frankly - this mis-alignment is not a huge issue! The reason I say this is that this app would fall outside of what I propose below...
So, here is my idea: why don't we set up a simple standard for the G-Sensor calibration, to be stored in the registry in a dedicated set of keys, and develop a quick and simple application to calibrate it and store the values in there (much like was done in BubbleLevel)?
As long as all developers here agree to use these values and stick to the standard... voila! We can all have a calibrated G-Sensor, which any future program will know how to read correctly (by correcting the values it gets with the offsets stored in the Registry to get a perfect reading).
What do you people think (especially all you developers out there)? Anyone care to volunteer a registry location and some key names?
That would be really great
that's exactly what we need...
Instead of using HTCSensorSDK.dll we could create a HTCCalibratedSensorSDK.dll (for example )
Exactly same interface, but calibrated... The developers only would have to change their dll names...
I did the day before a such dll for testing purposes, and its really simple (I even successed in 'calibrating' teeter when overwriting the original one..).
I think this is the thing we have to do...
Other inputs?
Sven
g-sensor not working
after i installed gsen my g-sensor dont work! when i try to play teeter the ball is stuck up and only moves left to right. also it opens my ktcalbum upside down. can the touchflo be reinstalled maybe? any idea?
svenso said:
that's exactly what we need...
Instead of using HTCSensorSDK.dll we could create a HTCCalibratedSensorSDK.dll (for example )
Exactly same interface, but calibrated... The developers only would have to change their dll names...
I did the day before a such dll for testing purposes, and its really simple (I even successed in 'calibrating' teeter when overwriting the original one..).
I think this is the thing we have to do...
Other inputs?
Sven
Click to expand...
Click to collapse
This sounds live a VERY good idea. Do I understand you correctly, that you actually have a basic version of the DLL already done???

Idea for the touch pro

Board, I am not a programmer, but I think a good idea would be to use the g sensor to allow you to scroll thru lists.
It would work by way of flicking the phone itself, like you would open a flip phone or shaking out a cigerette out of the box. That action (depending of how hard the flick was) would cause the list to scroll in that direction.
Is there any out ther like this?
Thanks for your time
Russell
I have to say what you're suggesting are quick subtle movements it would be next to impossible without excessive polling of the sensor, it would suck your battery in no time making it all but usable. It would also only work only on default windows scrollbar, not in touch optimized applications.
But I also have to say that things are impossible only so long before some oblivious fool stands up and do it
Already Exists...
A program like this already exists. I think its caled g-controller or something like that. Just google it

I Need Ideas - Raphael Programming

Hello all,
I recently started a course here at Purdue University on Mobile Software development (Windows Mobile).
I need some ideas for programs I should write. Please reply to this thread or PM me if you'd like.
I have experience with C#, VB, C++, and C, among other languages.
Thanks
Jason Flittner
how about a dedicated xda forum app?
How about a sports ticker. I'm still surprised there isn't one yet.
BTW, I think I saw a xda app when I was poking around the other night.
I'm trying to think of ideas but my minds drawing a blank...
Here's the XDApp
Gonna expose my nerdiness here, but you asked...
How about an app that accesses the D&D Insider online compendium of rules and data? Not sure what would be involved, but I'm betting that there's no API available, so it'll probably never happen.
OTOH, it would be nice to see a really high quality dice-rolling app that takes full advantage of the g-sensor and the hardware accelerated graphics...something that looks like dice inside a tumbler, you know? Maybe start with a really slick Yahtzee-style game, and build up to polyhedral dice for us game-geeks?
I'd be happy to provide you with some guidelines for building. I'm sure we could find you a suitably good graphics guy, too, if you're not up to that part (I could do that, in a pinch).
I want my phone to do this:
But until then, I would like to see an ap like Skype, but for mobile that will easily switch you from cellular network to VOIP.
I have two ideas:
#1 - I don't know if this is even possible, but an application that turns on WIFI and/or Bluetooth in a receive only mode briefly every few seconds and listens for user selected devices in range and then performs user selected actions.
The idea is that the it would use less power than leaving WIFI and/or Bluetooth on all the time, but when I get in range of my wifi router at home, it turn WIFI fully on and sync my phone. Or when I'm in range of the WiFi at work, it could turn my ringer to vibrate. Or when I get into the car, it detect my Bluetooth stero, connects to it, and opens the music player.
#2 - Probably simpler than #1, a program that turns WiFi and/or Bluetooth on automatically when the phone is plugged into a charger and then performs specific user defined actions, similar to idea #1.
I don't know if programs like this already exist, but I haven't found them.
Dylan
I like these ideas, please keep them coming. I am not sure what the requirements will be as far as our programming projects are concerned but from what I understand I have alot of freedom in project choices!
I am in another robotics programming class working with the iRobot Creates and I was thinking it would be really sweet to program something that could allow the 2 to interact in some way/shape/form!
I am also very excited about GPS technology I wouldn't mind programming something that would utilize the GPS or triangulation!
Thanks for the contributions all, please keep them coming!
~JFlitt
With all that programing skill you could create some pretty neat apps.
Ive always liked the windows desktop interface.
How about a windows xp-like launcher?
Complete with movable desktop icons, windows, etc.
I am aware that wisbar advance desktop allows you to do this, but alot of those skins are a hassle, and they are not very complete. Plus they dont exactly take advantage of any 3d graphic drivers..
But anyways back to the point, with a windows xp desktop like interface it would be easier to use the phone.
I would not have to stretch my thumb all the way to the top left of the phone.
Oh and you could possibly utilize the touch pros capacitive touch panel for controlling the mouse.
You could also get google android working with more functionality. I am aware that there is work being done on it, but someone with so much programing knowledge could really speed up the project.(Im android crazy)
Or, if all that is too much to complete in limited time, then how about an application that will allow multi touch using the touch panel?
And also, resistive touch screens are supposedly multi touch capable.
I hope i gave you enough ideas.
Good luck.
madfatter said:
how about a dedicated xda forum app?
Click to expand...
Click to collapse
ye s a facebook like app
But would love to see a app recreate the zoombar
on my tp
VOIP
Hi,
I have an idea and it is possible.
how about having an app on your phone to configure your SIP provider settings in it ( 5 different proxy ) and then when you want to dial a number, you can right click on it and chose " voip dial ".
Skype already gives you a the menu for skype calls when u right click on your contact .
if you can add a menu to TF3D settings->communication->VOIP and we can add 5 different proxy in it and we can activate more than one proxy at the same time in order to RECEIVE AND DIAL voip calls from our phone it would be awesome since microsoft is not allowing this kind of apps on marketplace .
Tnx
Thunder
a good "made for raphael" nes or snes emulator would be great since all the other ones out there are out dated and seem to work grat on old phones but are horribly laggy on the touch pro...wierd... the only good one ive found is a jap build of nester (nesterj4u) built for an hp phone or pda im not sure but the keyboard slides out to the right so landscape mode is upside down when i want to use the keyboard >_<
a good streaming media app thats a bit easyer to use than the one that comes with the phone would be great with some tv links on it like surfthechannel or tvdome would be great.
a youporn app to copliment the youtube app would be awsome
hmmm a good compass that simply points north (true or magnetic) with degrees would be awsome for when i drop mine on the roof trying to point my sat.
a simple freeware level would also be awsome since ive only found trialware levels so far
an hourglass would be a fun pointless app for when i get bored of pouring digital beer.
a goofy clip art picture editor could be fun just to mess with. maybe with some fish eye lens and carnival mirror opptions would be fun.
a free streaming radio app would be cool too....
sorry for the long list cant sleep ... figured the more ideas the better
ps. im not sure if any of these already exist havent checked lately so if anyone know if they do feal free to point me in the right direction it would be greatly appreciated
ok, I'm gonna try to have this make sense, but no guarantees. how about a simple titanium plugin framework? something that **doesn't** use mortscript? as mscript is good for certain things, it's not for others. this way there is an easier way for developers to make new plugins for it without having to use a slow scripting language. does that make any sense?
How about a talking GPS
I was out on my mountain bike today. I have a Garmin unit on the handle bars for navigation and listening to music from my Touch Pro in my pocket.
I was riding a fast downhill section through the some trees when I realized I was taking my eyes off the trail to make sure I was still on course.
I've used this http://www.basicgps.co.uk/ for Geocaching but it can only take you to one waypoint at a time. You can't use it to follow a route.
How about making an application which can steer you along a route using voice commands.
(Tomtom and others can only do this on roads, not off-road)
mixture of gps and accelerometer
well can u create an app the tells u ur speed while u are travelling like there is one app which does it in i phone it uses motion sensing and gps there are apis for both you can code it in c# with .net fw 3.5 and if u require help i am available i too know c# .
sound control
What about an app. that would control all of the sound feature such as the ear speaker,speaker phone speaker,and possibily microphone independitly,like bass,trebl,vol. That way a person could tailor the phone to sound the way they want it to sound when they are talking on it or whatever.
Just a thought.
Programing Ideas
A project that I have been toying with is a "Now" button for the calendar. Those of us in consulting need a simple and quick way to insert the current time in the Start Time and End Time field, which ever is selected. I've not been successful so far.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HARDWARE: AT&T HTC FUZE (Raphael)
Hard-SPL: AT&T
ROM: AT&T
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How about that app the iPhone has where you can transfer contacts by putting the phones next to each other and shaking it to transfer or sliding it across to the other phone.
All for now will think of more
*edit* Forget this its kind of pointless when we can send contacts via sms/IR beam
How about the ability to use our Fuze's as remote controls like you could with PDA's, open your garage door, turn on your 360 or TV, forgot to turn your laptop off, send it a signal to shut down from anywhere
There're some cool applications on Android. One application changes the ringtone based on GPS location. It sets ringtone to loud at home, lower the volume in office and automatically sets the phone to vibration when you are in a theater.
Another application is about setting alarm based on location. You can set an alarm about buying some stuff in a store, next time when you pass by the store, alarm goes off.

TP2 sensors API

I know that the TP2 come with different kind of sensors (ambient light, proximity, g-sensor) and wonder if we could make the most out of them.
There are lot of programs out there which make use of the g-sensor to rotate screen and so on.
What about the ambient light and proximity sensor? I have not come across any programs using them...
When I drive for example, I listen to music using my TP2. I can't really change the tracks since I am driving. I was thinking may be the proximity
sensor could help...
Eg. 1. Waving the hand in front of the sensor would move to the next track.
2. Leaving the hand in front of the sensor after few seconds would pause the music...
These are just simple ideas and I think many of you guys reading this will come with great ideas (even for the light sensor)....
My point for this post is that does anyone have/or can create API's for these sensors (It would be great if they were in .NET compact, would make life easier for developping apps.)
I am sorry for posting this in the ROM section but I think by posting it there, it will attract the attention of the ROM cooks, who I think would have come across these sensors and might have thought of doing something special with them
29 views already but no replies....
if you know c# this is everything you need
http://sensorapi.codeplex.com/SourceControl/changeset/view/11841#
Thats nice. thanks.
It does not seem to support promity sensors though, which will be the most interesting one.
It would be great if others came up with ideas of what can be done with these sensors...
jinjav said:
29 views already but no replies....
Click to expand...
Click to collapse
Maybe if you posted in the sub-forum for Windows Mobile software development (which is what your question sounds like) you'd get more response. I don't know for sure...but people who create new apps from scratch may be different people than rom cooks.
I'll do that as well. thanks
Did you look at TouchLockPro Recently the ZoomBar is added.
TouchLockPro is open source, so you can download the source code here at sourgeforge. So you can also see how to access all those other sensors too.
The idea behind it, is that others can learn from it and also make *FREE* beautiful programs. Just make sure you adhere to the open source license and make your code also public available
this post shows the approach and source code for the ZoomBar.
ZuinigeRijder said:
Did you look at TouchLockPro Recently the ZoomBar is added.
TouchLockPro is open source, so you can download the source code here at sourgeforge. So you can also see how to access all those other sensors too.
The idea behind it, is that others can learn from it and also make *FREE* beautiful programs. Just make sure you adhere to the open source license and make your code also public available
this post shows the approach and source code for the ZoomBar.
Click to expand...
Click to collapse
Thanks for that . Does it support the proximity sensor?
jinjav said:
Thanks for that . Does it support the proximity sensor?
Click to expand...
Click to collapse
No, unfortunately not. If you know the API I am also glad to know it too

Categories

Resources