<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>Windows Mobile Unified Sensor API</title><link>http://sensorapi.codeplex.com/project/feeds/rss</link><description>The Windows Mobile Unified Sensor API allows developers to easily access the hardware sensors that are available on various phones.       Sensors&amp;#58;   Light Sensor   Capacitive Touch Pad   Accelerometer      Devices&amp;#58;   HTC Touch &amp;#42;   Samsung Omnia&amp;#47;Instinct</description><item><title>Source code checked in, #76924</title><link>http://sensorapi.codeplex.com/SourceControl/changeset/changes/76924</link><description>Upgrade&amp;#58; New Version of LabDefaultTemplate.xaml. To upgrade your build definitions, please visit the following link&amp;#58; http&amp;#58;&amp;#47;&amp;#47;go.microsoft.com&amp;#47;fwlink&amp;#47;&amp;#63;LinkId&amp;#61;254563</description><author>Project Collection Service Accounts</author><pubDate>Mon, 01 Oct 2012 21:29:18 GMT</pubDate><guid isPermaLink="false">Source code checked in, #76924 20121001092918P</guid></item><item><title>Source code checked in, #76923</title><link>http://sensorapi.codeplex.com/SourceControl/changeset/changes/76923</link><description>Checked in by server upgrade</description><author>Project Collection Service Accounts</author><pubDate>Mon, 01 Oct 2012 21:23:54 GMT</pubDate><guid isPermaLink="false">Source code checked in, #76923 20121001092354P</guid></item><item><title>New Post: HTC device with WM 6.x, accelerometer, GPS &amp; light sensor?</title><link>http://sensorapi.codeplex.com/discussions/267500</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi there!&lt;/p&gt;
&lt;p&gt;I&amp;acute;m just planning on a program that will be using the accelerometer of a HTC device running Windows Mobile 6.x. I will have to buy a device for testing, so I&amp;acute;m looking for a used (=possibly cheap) one. It must have internal GPS and an accelerometer.
 I also have an idea for using the light sensor - wich one would be the best for this, if there is any that has all those features?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br&gt;
Danyel&lt;/p&gt;
&lt;/div&gt;</description><author>TTRCmedia</author><pubDate>Tue, 02 Aug 2011 20:30:12 GMT</pubDate><guid isPermaLink="false">New Post: HTC device with WM 6.x, accelerometer, GPS &amp; light sensor? 20110802083012P</guid></item><item><title>New Post: Keep Landscape screen B7610</title><link>http://sensorapi.codeplex.com/discussions/248695</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;Could anyone know how to place the mobile B7610 always is landscape mode that looks like its VideoEditor app?&lt;br&gt;
If our app is deactivated, it should be rollback old state before.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br&gt;
abo&lt;/p&gt;
&lt;/div&gt;</description><author>abo</author><pubDate>Mon, 07 Mar 2011 10:53:55 GMT</pubDate><guid isPermaLink="false">New Post: Keep Landscape screen B7610 20110307105355A</guid></item><item><title>New Post: test apps in emulator</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=230145</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am new to mobile apps development. I would like to use this API in a new application and I have some dificulties. I use VS2008. Is there any way of runnig the test application you provided in an wm6.1 mobile emulator? How can this API be tested outside a real device? Is there lets say a HTC HD emulator to install in VS2008?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;&lt;/div&gt;</description><author>illusion86</author><pubDate>Fri, 08 Oct 2010 11:57:10 GMT</pubDate><guid isPermaLink="false">New Post: test apps in emulator 20101008115710A</guid></item><item><title>Source code checked in, #49966</title><link>http://sensorapi.codeplex.com/SourceControl/changeset/changes/49966</link><description>Checked in by server upgrade</description><author>_TFSSERVICE</author><pubDate>Mon, 19 Jul 2010 20:19:27 GMT</pubDate><guid isPermaLink="false">Source code checked in, #49966 20100719081927P</guid></item><item><title>New Post: Samsung B7610</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=213022</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;In your experience is there a chance that this API works on Samsung's B7610 phone?&lt;/p&gt;
&lt;p&gt;I tried to use http://forum.xda-developers.com/showthread.php?t=494267 (that application uses code from this project) with no luck&lt;/p&gt;
&lt;p&gt;Thanks a lot&lt;/p&gt;
&lt;p&gt;Andrea&lt;/p&gt;&lt;/div&gt;</description><author>oipaz</author><pubDate>Tue, 18 May 2010 12:55:56 GMT</pubDate><guid isPermaLink="false">New Post: Samsung B7610 20100518125556P</guid></item><item><title>New Post: HTC HD2 Compass Sensor (Revealed?)</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=212027</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I read a lot of articles on these sensors today, tryed this API, also my own (C++ only, I don't like managed code vary much). Because I have got HTC HD2, and it has a compass.... just guess what I'm thinking about...&lt;br&gt;I've found that HTCSensorOpen() with DWORD parameter of 3, returns valid HANDLE to a sensor, not currently present in the API. So a little investigation gives nice results.&lt;/p&gt;
&lt;p&gt;Set that structure:&lt;/p&gt;
&lt;div style="color:black;background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;struct&lt;/span&gt; COMPASSDATA {
    SHORT raw[5];
};
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;and call these:&lt;/p&gt;
&lt;div style="color:black;background-color:white"&gt;
&lt;pre&gt;&lt;div style="color:black;background-color:white"&gt;&lt;pre&gt;COMPASSDATA cd;
HANDLE sensor = HTCSensorOpen(3)
DWORD retCode = HTCSensorGetDataOutput(sensor, &amp;amp;cd);
SHORT NorthEscape = cd.raw[4];&lt;span style="color:green"&gt;//the angle in degrees from the north pole&lt;/span&gt;
HTCSensorClose(sensor);
&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;this gives the angle from Y axis to the north magnetic pole. 100% working, compared with built-in compass application. I Have no idea what other values do, but they are definitely SHORTs (every second byte becomes 0 quite often), and they are definitely 5 in total.&lt;/p&gt;
&lt;p&gt;Hope to be of use&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;/div&gt;</description><author>uzi1</author><pubDate>Sat, 08 May 2010 18:51:55 GMT</pubDate><guid isPermaLink="false">New Post: HTC HD2 Compass Sensor (Revealed?) 20100508065155P</guid></item><item><title>New Post: htc hd2</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=211573</link><description>&lt;div style="line-height: normal;"&gt;Does it work for HTC HD2?&lt;/div&gt;</description><author>kaansengul</author><pubDate>Tue, 04 May 2010 21:01:23 GMT</pubDate><guid isPermaLink="false">New Post: htc hd2 20100504090123P</guid></item><item><title>New Post: gsensor moves on it's own?</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=203592</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;I'm writing a program that uses the gsensor on my HTC HD2. And for some reason the sensor seems to move, even though it's lying perfectly still on my table. When running the ball demo, the ball is rolling around without anybody touching the phone. I've calibrated the sensor with the built in calibration tool. But I still get this random movements.&lt;/p&gt;
&lt;p&gt;Is it supposed to do this, or have I missed something?&lt;/p&gt;&lt;/div&gt;</description><author>Smetad_Anarkist</author><pubDate>Tue, 02 Mar 2010 19:48:19 GMT</pubDate><guid isPermaLink="false">New Post: gsensor moves on it's own? 20100302074819P</guid></item><item><title>Patch Uploaded: #5206</title><link>http://sensorapi.codeplex.com/SourceControl/PatchList.aspx</link><description>
&lt;p&gt;&lt;a href='http://www.codeplex.com/site/users/view/iamspv'&gt;iamspv&lt;/a&gt; has uploaded a patch.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Description:&lt;/b&gt;&lt;br /&gt;LG GM750 accelerometer sensor support&lt;/p&gt;</description><author>iamspv</author><pubDate>Mon, 08 Feb 2010 10:44:50 GMT</pubDate><guid isPermaLink="false">Patch Uploaded: #5206 20100208104450A</guid></item><item><title>New Post: solution for LG GM750 accelerometer</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=83029</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;This solution is based on the Samsung sensor class, modified to meet the peculiarities of the LG GM750.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;First of all, the import of the DeviceIoControl in NativeMethods.cs must be modified such way dwIoControlCode is type uint, and the buffers are byte:&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt; [DllImport(&lt;span style="color:#A31515"&gt;&amp;quot;coredll&amp;quot;&lt;/span&gt;, CharSet = CharSet.Auto, SetLastError = &lt;span style="color:Blue"&gt;true&lt;/span&gt;)]
        &lt;span style="color:Blue"&gt;public&lt;/span&gt; &lt;span style="color:Blue"&gt;static&lt;/span&gt; &lt;span style="color:Blue"&gt;extern&lt;/span&gt; &lt;span style="color:Blue"&gt;bool&lt;/span&gt; DeviceIoControl(IntPtr hDevice, &lt;span style="color:Blue"&gt;uint&lt;/span&gt; dwIoControlCode, [In] &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[] inBuffer, &lt;span style="color:Blue"&gt;int&lt;/span&gt; nInBufferSize, [Out] &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[] outBuffer, &lt;span style="color:Blue"&gt;int&lt;/span&gt; nOutBufferSize, &lt;span style="color:Blue"&gt;ref&lt;/span&gt; &lt;span style="color:Blue"&gt;int&lt;/span&gt; pBytesReturned, IntPtr lpOverlapped);
&lt;/pre&gt;
&lt;pre&gt;After a long time dissassembling the accelsensor.dll and and a lot of trial and error testing I came to this conclusion that works:&lt;/pre&gt;
&lt;pre&gt;The constant that starts/stops data output becomes:&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:Black;background-color:White"&gt;&lt;pre&gt;        &lt;span style="color:Blue"&gt;const&lt;/span&gt; &lt;span style="color:Blue"&gt;uint&lt;/span&gt; ACCOnRot = 0x1014EE8;
        &lt;span style="color:Blue"&gt;const&lt;/span&gt; &lt;span style="color:Blue"&gt;uint&lt;/span&gt; ACCOffRot = 0x1014EE8;
and for reading values:&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:Black;background-color:White"&gt;&lt;pre&gt;&lt;span style="color:Blue"&gt;const&lt;/span&gt; &lt;span style="color:Blue"&gt;uint&lt;/span&gt; ACCReadValues = 0x1014F10;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
The difference between start and stop comes from the input given in DeviceIoControl method as follows:&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:Black;background-color:White"&gt;&lt;pre&gt;        &lt;span style="color:Blue"&gt;public&lt;/span&gt; &lt;span style="color:Blue"&gt;static&lt;/span&gt; LGAccSensor Create()
        {
            DeviceIoControl(ACCOnRot, &lt;span style="color:Blue"&gt;new&lt;/span&gt; &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[1] &lt;strong&gt;{1}&lt;/strong&gt;, &lt;span style="color:Blue"&gt;new&lt;/span&gt; &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[4] );
            &lt;span style="color:Blue"&gt;return&lt;/span&gt; &lt;span style="color:Blue"&gt;new&lt;/span&gt; LGAccSensor();
        }
&lt;div style="color:Black;background-color:White"&gt;&lt;pre&gt;        &lt;span style="color:Blue"&gt;protected&lt;/span&gt; &lt;span style="color:Blue"&gt;override&lt;/span&gt; &lt;span style="color:Blue"&gt;void&lt;/span&gt; Dispose(&lt;span style="color:Blue"&gt;bool&lt;/span&gt; disposing)
        {
            &lt;span style="color:Blue"&gt;base&lt;/span&gt;.Dispose(disposing);
            DeviceIoControl(ACCOffRot, &lt;span style="color:Blue"&gt;new&lt;/span&gt; &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[1] &lt;strong&gt;{0}&lt;/strong&gt;, &lt;span style="color:Blue"&gt;new&lt;/span&gt; &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[1] );
        }
&lt;/pre&gt;
&lt;pre&gt;The DeviceIoControl inside the accelerometer class becomes&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:Black;background-color:White"&gt;&lt;pre&gt; &lt;span style="color:Blue"&gt;public&lt;/span&gt; &lt;span style="color:Blue"&gt;static&lt;/span&gt; &lt;span style="color:Blue"&gt;void&lt;/span&gt; DeviceIoControl(&lt;span style="color:Blue"&gt;uint&lt;/span&gt; controlCode, &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[] inBuffer, &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[] outBuffer)
        {


                IntPtr file = NativeMethods.CreateFile(&lt;span style="color:#A31515"&gt;&amp;quot;ACC1:&amp;quot;&lt;/span&gt;, 0, 0, IntPtr.Zero, ECreationDisposition.OpenExisting, 0, IntPtr.Zero);
                &lt;span style="color:Blue"&gt;if&lt;/span&gt; (file == (IntPtr)(-1))
                    &lt;span style="color:Blue"&gt;throw&lt;/span&gt; &lt;span style="color:Blue"&gt;new&lt;/span&gt; InvalidOperationException(&lt;span style="color:#A31515"&gt;&amp;quot;Unable to Create File&amp;quot;&lt;/span&gt;);

                &lt;span style="color:Blue"&gt;try&lt;/span&gt;
                {

                    &lt;span style="color:Blue"&gt;int&lt;/span&gt; bytesReturned = 0;
                    &lt;span style="color:Blue"&gt;int&lt;/span&gt; inSize = &lt;span style="color:Blue"&gt;sizeof&lt;/span&gt;(&lt;span style="color:Blue"&gt;byte&lt;/span&gt;) * inBuffer.Length;
                    &lt;span style="color:Blue"&gt;int&lt;/span&gt; outSize = &lt;span style="color:Blue"&gt;sizeof&lt;/span&gt;(&lt;span style="color:Blue"&gt;byte&lt;/span&gt;) * outBuffer.Length;
                    &lt;span style="color:Blue"&gt;if&lt;/span&gt; (!NativeMethods.DeviceIoControl(file, controlCode, inBuffer, inSize, outBuffer, outSize, &lt;span style="color:Blue"&gt;ref&lt;/span&gt; bytesReturned, IntPtr.Zero))
                            &lt;span style="color:Blue"&gt;throw&lt;/span&gt; &lt;span style="color:Blue"&gt;new&lt;/span&gt; InvalidOperationException(&lt;span style="color:#A31515"&gt;&amp;quot;Unable to perform operation.&amp;quot;&lt;/span&gt;);

                  
                }

                &lt;span style="color:Blue"&gt;finally&lt;/span&gt;
                {
                    NativeMethods.CloseHandle(file);
                }      
        }
&lt;/pre&gt;
&lt;/div&gt;
Note that the accelerometer device is called &lt;strong&gt;ACC1:&lt;/strong&gt;.&lt;/pre&gt;
&lt;pre&gt;Further the method that returns the three component vector becomes&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:Black;background-color:White"&gt;&lt;pre&gt;        &lt;span style="color:Blue"&gt;public&lt;/span&gt; &lt;span style="color:Blue"&gt;override&lt;/span&gt; GVector GetGVector()
        {
            &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[] outBuffer = &lt;span style="color:Blue"&gt;new&lt;/span&gt; &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[4];
            DeviceIoControl(ACCReadValues, &lt;span style="color:Blue"&gt;new&lt;/span&gt; &lt;span style="color:Blue"&gt;byte&lt;/span&gt;[1] {1}, outBuffer);
            GVector ret = &lt;span style="color:Blue"&gt;new&lt;/span&gt; GVector();
          
            
            &lt;span style="color:Blue"&gt;int&lt;/span&gt; accx = outBuffer[2];
            &lt;span style="color:Blue"&gt;if&lt;/span&gt; (accx &amp;lt;=31)
                ret.X = accx/2.17;
            &lt;span style="color:Blue"&gt;else&lt;/span&gt;
                ret.X = (accx-64)*0.47;
            ret.X = -ret.X;
            &lt;span style="color:Blue"&gt;int&lt;/span&gt; accy = outBuffer[1] ;
            &lt;span style="color:Blue"&gt;if&lt;/span&gt; (accy &amp;lt;=31)
                ret.Y =  accy/2.17;
            &lt;span style="color:Blue"&gt;else&lt;/span&gt;
                ret.Y = (accy - 64) * 0.47;

            &lt;span style="color:Blue"&gt;int&lt;/span&gt; accz = outBuffer[0] ;
            &lt;span style="color:Blue"&gt;if&lt;/span&gt; (accz &amp;lt;=31)
                ret.Z = accz/2.17;
            &lt;span style="color:Blue"&gt;else&lt;/span&gt;
                ret.Z = (accz - 64) * 0.47;
            &lt;span style="color:Blue"&gt;double&lt;/span&gt; somefactor = 1;&lt;/pre&gt;
&lt;pre&gt;            &lt;span style="color:Blue"&gt;return&lt;/span&gt; ret.Scale(somefactor);
        }
Note that the when called with AccReadValues parameter, the DeviceIoControl returns three bytes each of them containing a signed 6 bit 2's complement value.&lt;/pre&gt;
&lt;pre&gt;Basicly there are values on 6 bit ranging from -32 to +31. In the docs below there are tables that put in correspondence these values with acceleration in range -1.5g +1.5g which are the limits of the device. The code I wrote returns acceleration in meters/second2 where 1g=9.8 m/s2&lt;/pre&gt;
&lt;pre&gt;That information I extracted from the technical specifications of the MMA7660FC accelerometer, as found at&lt;/pre&gt;
&lt;pre&gt;&lt;a href="http://www.comtech.com.cn/pdf/FSL-MMA7660FC.pdf"&gt;http://www.comtech.com.cn/pdf/FSL-MMA7660FC.pdf&lt;/a&gt;. Also, the type of the accelerometer circuit is found in the service manual (I only found the service manual for LG GM730 which is pretty close).&lt;/pre&gt;
&lt;pre&gt;Please, update the library with this code.&lt;/pre&gt;
&lt;pre&gt;Enjoy!&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>iamspv</author><pubDate>Wed, 03 Feb 2010 16:09:10 GMT</pubDate><guid isPermaLink="false">New Post: solution for LG GM750 accelerometer 20100203040910P</guid></item><item><title>New Post: Proximity sensor into the API?</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=73847</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;No news?&lt;/p&gt;&lt;/div&gt;</description><author>buckley10</author><pubDate>Wed, 03 Feb 2010 15:03:58 GMT</pubDate><guid isPermaLink="false">New Post: Proximity sensor into the API? 20100203030358P</guid></item><item><title>New Post: Unable to run samples</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=68772</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;You have to deploy the project. Go to Build &amp;gt; Configuration Manager... and select all projects to build and to deploy, in both debug and release.&lt;/p&gt;&lt;/div&gt;</description><author>Zbyl</author><pubDate>Thu, 28 Jan 2010 15:20:08 GMT</pubDate><guid isPermaLink="false">New Post: Unable to run samples 20100128032008P</guid></item><item><title>New Post: G-Sensor Help</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=82091</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I need some help.&amp;nbsp; I am brand new to Visual Studio and C#.&amp;nbsp; I am a long time PHP programmer that has beginning to play with C# and windows mobile. I have some classic Visual Basic 6 experience, but not a lot.&lt;/p&gt;
&lt;p&gt;My problem is the documentation for this API is basically non-exsistance.&amp;nbsp; And the Sample code for the G-Sensor is confusing to a newbie like me.&amp;nbsp; While I am sure the sample code was developed to show the power of the API, when reading it over and trying to figure out where the values are calculated, makes me want to throw my phone through a wall.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have been able to look at sample codes for other functions (i.e. change registry value, gps, etc) and been able to follow them fairly effiecently.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am hoping that maybe someone will provide simple code, that will just display the values on the screen is a super simple manner.&amp;nbsp; i.e.&lt;/p&gt;
&lt;p&gt;X Vector: 0.0 &lt;br&gt;Y Vector: 0.0 &lt;br&gt;Z Vector: 0.0 &lt;br&gt;Nav Data: 0 &lt;br&gt;Light Sensor: 1 &lt;br&gt;Stlyus Sensor: 1&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It can be something as simple as just updating the Text on a label.&amp;nbsp; :-) I am smart enough to know how to intrupt the values from there... and it hopefully it will help me learn more about this crazy thing called C#&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>webdude12</author><pubDate>Tue, 26 Jan 2010 21:28:20 GMT</pubDate><guid isPermaLink="false">New Post: G-Sensor Help 20100126092820P</guid></item><item><title>New Post: sensors.dll with VB.net 2008</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=81904</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Just wanted to contribute some code because I did not find it somewhere else on the net. This is to access the sensors data with vb.net.&lt;br&gt;You need to compile the sensors.dll (VC.net) and reference it in your vb.net project first!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;&lt;span style="color:Blue"&gt;Imports&lt;/span&gt; Sensors

&lt;span style="color:Blue"&gt;Public&lt;/span&gt; &lt;span style="color:Blue"&gt;Class&lt;/span&gt; Gsensor
    &lt;span style="color:Blue"&gt;Dim&lt;/span&gt; mySensor &lt;span style="color:Blue"&gt;As&lt;/span&gt; IGSensor = GSensorFactory.CreateGSensor


    &lt;span style="color:Blue"&gt;Private&lt;/span&gt; &lt;span style="color:Blue"&gt;Sub&lt;/span&gt; Timer1_Tick(&lt;span style="color:Blue"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:Blue"&gt;As&lt;/span&gt; System.Object, &lt;span style="color:Blue"&gt;ByVal&lt;/span&gt; e &lt;span style="color:Blue"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color:Blue"&gt;Handles&lt;/span&gt; Timer1.Tick
        &lt;span style="color:Blue"&gt;Dim&lt;/span&gt; mySensor &lt;span style="color:Blue"&gt;As&lt;/span&gt; IGSensor = GSensorFactory.CreateGSensor()
        &lt;span style="color:Blue"&gt;Dim&lt;/span&gt; vx, vy, vz, vv
        &lt;span style="color:Blue"&gt;Dim&lt;/span&gt; gvector = mySensor.GetGVector()
        Label1.Text = gvector.ToString() &amp;amp; &lt;span style="color:#A31515"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &amp;amp; mySensor.Orientation
        vv = gvector.ToString()
        vx = Trim(Mid(vv, 3, InStr(vv, &lt;span style="color:#A31515"&gt;&amp;quot;Y=&amp;quot;&lt;/span&gt;) - 3))

        vy = Trim(Mid(vv, InStr(vv, &lt;span style="color:#A31515"&gt;&amp;quot;Y=&amp;quot;&lt;/span&gt;) + 2, InStr(vv, &lt;span style="color:#A31515"&gt;&amp;quot;Z=&amp;quot;&lt;/span&gt;) - InStr(vv, &lt;span style="color:#A31515"&gt;&amp;quot;Y=&amp;quot;&lt;/span&gt;) - 3))

        vz = Trim(Mid(vv, InStr(vv, &lt;span style="color:#A31515"&gt;&amp;quot;Z=&amp;quot;&lt;/span&gt;) + 2, Len(vv) - (InStr(vv, &lt;span style="color:#A31515"&gt;&amp;quot;Z=&amp;quot;&lt;/span&gt;))))

        Label2.Text = vx
        Label3.Text = vy
        Label4.Text = vz

        tbx.Value = Val(vx)
        tby.Value = Val(vy)
        tbz.Value = Val(vz)

    &lt;span style="color:Blue"&gt;End&lt;/span&gt; &lt;span style="color:Blue"&gt;Sub&lt;/span&gt;

    &lt;span style="color:Blue"&gt;Private&lt;/span&gt; &lt;span style="color:Blue"&gt;Sub&lt;/span&gt; MenuItem1_Click(&lt;span style="color:Blue"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:Blue"&gt;As&lt;/span&gt; System.Object, &lt;span style="color:Blue"&gt;ByVal&lt;/span&gt; e &lt;span style="color:Blue"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color:Blue"&gt;Handles&lt;/span&gt; MenuItem1.Click
        Timer1.Enabled = &lt;span style="color:Blue"&gt;True&lt;/span&gt;
    &lt;span style="color:Blue"&gt;End&lt;/span&gt; &lt;span style="color:Blue"&gt;Sub&lt;/span&gt;

    &lt;span style="color:Blue"&gt;Private&lt;/span&gt; &lt;span style="color:Blue"&gt;Sub&lt;/span&gt; MenuItem2_Click(&lt;span style="color:Blue"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:Blue"&gt;As&lt;/span&gt; System.Object, &lt;span style="color:Blue"&gt;ByVal&lt;/span&gt; e &lt;span style="color:Blue"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color:Blue"&gt;Handles&lt;/span&gt; MenuItem2.Click
        Timer1.Enabled = &lt;span style="color:Blue"&gt;False&lt;/span&gt;
        mySensor.Dispose()
    &lt;span style="color:Blue"&gt;End&lt;/span&gt; &lt;span style="color:Blue"&gt;Sub&lt;/span&gt;
&lt;span style="color:Blue"&gt;End&lt;/span&gt; &lt;span style="color:Blue"&gt;Class&lt;/span&gt;
&lt;/pre&gt;
&lt;pre&gt;T.u.b.e.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description><author>tube</author><pubDate>Mon, 25 Jan 2010 09:51:19 GMT</pubDate><guid isPermaLink="false">New Post: sensors.dll with VB.net 2008 20100125095119A</guid></item><item><title>New Post: LG Eigen (GM730  - GM735) accelometer</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=79607</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LG GM730 has an accelometer rotating the screen wfor messaging and picture reviewing in landscape.&lt;/p&gt;
&lt;p&gt;Can the same sensor be used to play sensor games developed for HTC, samsung touch PDAs?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>ghaluk</author><pubDate>Sun, 03 Jan 2010 17:25:37 GMT</pubDate><guid isPermaLink="false">New Post: LG Eigen (GM730  - GM735) accelometer 20100103052537P</guid></item><item><title>New Post: High frequency GSensor polling on HTC devices</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=78940</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I recently noticed that if the GSensor on my Touch Pro2 is queried more than around about 25 times per second, it stops providing useful data back and just returns the most recent vector over and over again. As my project was updating at a higher frequency than this, it presented a bit of a problem.&lt;/p&gt;
&lt;p&gt;I implemented a fix for this into my copy of the code, which I thought I'd share in case anyone else found it useful. This limits the GSensor polling to a maximum of 25 times per second, regardless of how frequently the GetGVector() function is called. If calls are within 1/25th of the last poll, the last-polled vector is returned without querying the sensor again. Once sufficient time has elapsed, the next call will actually interrogate the sensor.&lt;/p&gt;
&lt;p&gt;The change requires the following variables to be added at class level to the HTCSensor.cs file:&lt;/p&gt;
&lt;pre&gt;        private GVector _lastVector;
        private int _lastSampleTicks;
&lt;/pre&gt;
&lt;p&gt;Once these have been added, the GetGVector function can be modified as follows:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;        &lt;span style="color:Blue"&gt;public&lt;/span&gt; &lt;span style="color:Blue"&gt;override&lt;/span&gt; GVector GetGVector()
        {
            &lt;span style="color:Green"&gt;// The GSensor freezes up when inundated with requests.&lt;/span&gt;
            &lt;span style="color:Green"&gt;// Ensure that at least 1/25th of a second has passed since we were&lt;/span&gt;
            &lt;span style="color:Green"&gt;// last interrogated. If not, return the most recently retrieved value.&lt;/span&gt;
            &lt;span style="color:Blue"&gt;if&lt;/span&gt; (Environment.TickCount - _lastSampleTicks &amp;lt; (1000 / 25) &amp;amp;&amp;amp; _lastVector.Length != 0)
            {
                &lt;span style="color:Blue"&gt;return&lt;/span&gt; _lastVector;
            }

            GVector ret = &lt;span style="color:Blue"&gt;new&lt;/span&gt; GVector();
            HTCGSensorData data = GetRawSensorData();
            ret.X = data.TiltX;
            ret.Y = data.TiltY;
            ret.Z = data.TiltZ;
            &lt;span style="color:Green"&gt;// HTC's Sensor returns a vector which is around 1000 in length on average..&lt;/span&gt;
            &lt;span style="color:Green"&gt;// but it really depends on how the device is oriented.&lt;/span&gt;
            &lt;span style="color:Green"&gt;// When simply face up, my Diamond returns a vector of around 840 in length.&lt;/span&gt;
            &lt;span style="color:Green"&gt;// While face down, it returns a vector of around 1200 in length.&lt;/span&gt;
            &lt;span style="color:Green"&gt;// The vector direction is fairly accurate, however, the length is clearly not extremely precise.&lt;/span&gt;
            &lt;span style="color:Blue"&gt;const&lt;/span&gt; &lt;span style="color:Blue"&gt;double&lt;/span&gt; htcScaleFactor = 1.0 / 1000.0 * 9.8;

            &lt;span style="color:Green"&gt;// Store the timestamp and vector for the next call in case it is too quick&lt;/span&gt;
            _lastSampleTicks = Environment.TickCount;
            _lastVector = ret.Scale(htcScaleFactor);

            &lt;span style="color:Blue"&gt;return&lt;/span&gt; ret.Scale(htcScaleFactor);
        }
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;With this change in place my code now works perfectly. Even though the GSensor values returned by GetGVector are sometimes cached, this is not apparent at all in my application, and the freezing sensor results that I experienced before have gone.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Adam.&lt;br&gt; &lt;a href="http://www.adamdawes.com/"&gt;www.adamdawes.com&lt;/a&gt;&lt;br&gt; &lt;a href="http://www.icangames.com/"&gt;www.icangames.com&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><author>AdamDawes</author><pubDate>Wed, 23 Dec 2009 13:55:37 GMT</pubDate><guid isPermaLink="false">New Post: High frequency GSensor polling on HTC devices 20091223015537P</guid></item><item><title>New Post: Proximity sensor into the API?</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=73847</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I am looking for the same feature as well. The proximity should be added. Is it going to happen?&lt;/p&gt;&lt;/div&gt;</description><author>jinjav</author><pubDate>Thu, 17 Dec 2009 14:12:29 GMT</pubDate><guid isPermaLink="false">New Post: Proximity sensor into the API? 20091217021229P</guid></item><item><title>New Post: Help with Toshiba TG01 G-Sensor</title><link>http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=65024</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Try this post, has an api pdf attached.&lt;/p&gt;
&lt;p&gt;http://forum.xda-developers.com/showthread.php?t=562976#2&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>weston</author><pubDate>Tue, 03 Nov 2009 21:44:53 GMT</pubDate><guid isPermaLink="false">New Post: Help with Toshiba TG01 G-Sensor 20091103094453P</guid></item></channel></rss>