![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
It would be real cool to be able to use this in B4PPC,
Is there any way of using what this guy made? Apparently he wrote a "managed wrapper" for the Sensor API, I opened the file, but i think it is currently meant for VS (e.g. i couldn't find a DLL) |
|
||||
|
You try this
AT YOUR OWN RISK I've no idea if it will work. Best case it will work, probably it will fail benignly, at worst you will need to hard reset your device and reinstall everything!The original code required VS2008 and the WM6.0 SDK, neither of which I have. However I stripped out the device orientation bits of code, which won't compile with my system ,and and compiled the rest under VS2005 for WM5.0 devices. I can't test the code but it is pretty simple. Make a HTCGSensor object and New it. Then call GetRawSensorData whenever you want to get the data. The data is returned relative to the screen face. Dim data(0) ... HTCGSensor.New ... data() = HTCGSensor.GetRawSensorData In the unlikely event that it works the data is returned in a 20 byte array described in the struct at the start of the source file in the zip. You can reassemble the data the hard way by multiplying and adding bytes or by using my ByteConverter library ByteConverter library |
|
|||
|
Thanks agraham, that was quick
I don't have a Diamond yet, I'm waiting for the stock, should be end of next week if everything goes well after shoving the data through your ByteConverter Lib, will it give me an orientation or the X,Y,Z axis? |
|
|||
|
Hi agraham,
Just got my t-Mobilized Diamond so I though i'd give this a go. In the IDE I made a form and included the HTCSensor.dll when hitting F5 i get the following error - unable to find an entry point named HTCSendorOpen in DLL HTCSensorSDK next I copy pasted Sensor.DLL and renamed it to HTCSensorSDK.DLL That didn't help... ![]() |
|
||||
|
Quote:
Googling I found this "But HTCSensorSDK.dll is on ROM (I think) and not removeable" which implies that it should be on the device. I am afraid that I can't be of further help. The code requires that entry point in that dll. ![]() |
|
|||
|
Yes I did, sorry..
I found the HTCSensorSDK.DLL on my device, so I copied it to the same dir as the sbp file. next I change the sbp file to : Code:
Sub App_Start Form1.Show sen.New1 'TextBox1.Text = sen.GetRawSensorData Msgbox(sen.ToString) End Sub when I use the GetRawSensorData I get a "NotSupportedException" Does that help you in any way? |
|
|||
|
Quote:
I've used "TextBox1.Text = sen.ToString(sen.GetRawSensorData)" in this case but to be sure i also did TextBox1.Text = sen.GetRawSensorData same result ![]() |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|