[VB.NET] Windows 8 Sensors
Posted: Wed Jul 16, 2014 10:45 pm
A while back I had to make an end of year project for my IT class and I chose to make a (somewhat believable) clone of the popular mobile game Temple Run. Since we could use Windows tablets instead of the desktop if we wanted, I decided to challenge myself further and use the available sensors on the tablet to control part of the game.
Trouble is, though, that we were using Xojo (formerly known as REALbasic) to develop our applications. It's great and all, but it does not by default support the Windows 8 sensors. VB.NET, on the other hand, does, and Xojo allows you to import DLLs written in another language and use their functions.
So I developped a DLL with a few functions that interface with the different sensors available on a Windows tablet (accelerometer, compas, gyrometer, inclinometer and light sensor). Each function returns a String, but you could easily modify them to return any type of data you wish... I chose String because it worked best with Xojo.
Anyway, I thought I might post the source here, in case you too need these functions outside of a .NET language. Enjoy ;)
Trouble is, though, that we were using Xojo (formerly known as REALbasic) to develop our applications. It's great and all, but it does not by default support the Windows 8 sensors. VB.NET, on the other hand, does, and Xojo allows you to import DLLs written in another language and use their functions.
So I developped a DLL with a few functions that interface with the different sensors available on a Windows tablet (accelerometer, compas, gyrometer, inclinometer and light sensor). Each function returns a String, but you could easily modify them to return any type of data you wish... I chose String because it worked best with Xojo.
Anyway, I thought I might post the source here, in case you too need these functions outside of a .NET language. Enjoy ;)