HTC Light Sensor API

lightsensor

Goofed around with the HTCSensorSDK.dll some more and figured out how to access the light sensor. I've updated the HTC Accelerometer API to allow access to the light sensor, and converted the values to make it developer friendly. The API exposes the following:

GetLumens

This returns a double value that describes the environmental lumens. It works decent at best, but it's a starting point. I calibrated this using a lightbulb, monitor, and other random light sources around the house I had the lumens values available for.

Brightness

Retrieves an arbitrary enum that describes the brightness of the environment. Values are Dark, Dim, Normal, and Bright.

BrightnessChanged

This event will notify you whenever the brightness changes.

You can download the API here. Let me know if you find any bugs!

Update:

I've updated the SDK to access the Nav sensor as well!

5 comments:

ageye said...

works great!
Though extreme researching it's still not possible for me to change the brightness of the backlight - I know this is a different issue but I hope that you can give me a hint how I can do it...
thx!

lenny76 said...

is it possible to debug the sdk in vs2008?

Vangold said...

On the HTC Touch Diamond2, from C++ native code calling HTCSensorGetDataOutput, I have seen raw values for luminance from 0 (covering the sensor) to at least 240 in outdoor sunlight, and thought I saw wrapping back past 0; and in the padding/reserved0 word I observed 0 while backlight was low, up to 9 in outdoor sunlight. The padding word drops slowly in a few seconds in a time delay after moving into a shady location.

Joshua Smith said...

Thanks for useful information. For industry solutions it is the right way to get outsource software development services.

Joshua Smith said...

A lot of thanks for this great tips. Casino affiliates always look for casino programs for partners to increase their revenue income from best casinos or poker rooms.