Recent

Author Topic: Accelerometer  (Read 3822 times)

Daniello

  • Jr. Member
  • **
  • Posts: 64
Accelerometer
« on: June 27, 2012, 01:11:20 am »
I'm trying to get access to the accelerometer. Since sensor.h was not translated to Pascal yet, I translated it myself. Here it is:
http://pastebin.com/Qb2Ke35L

However my application seems to crash when I call ASensorEventQueue_getEvents()
I'm not sure if I translated the ASensorEvent struct correctly, could anyone check?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Accelerometer
« Reply #1 on: June 27, 2012, 07:51:08 am »
The LCL has support for accelerometer and the example application shows how to use it. It is in the Form2. I utilized JNI to implement it.

See the documentation: http://wiki.lazarus.freepascal.org/LazDeviceAPIs#Accelerometer
« Last Edit: June 27, 2012, 08:08:45 am by felipemdc »

Daniello

  • Jr. Member
  • **
  • Posts: 64
Re: Accelerometer
« Reply #2 on: June 27, 2012, 06:02:52 pm »
Thanks Felipe, I'll look into it :)

 

TinyPortal © 2005-2018