Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Measuring height/depth with accelerometer
Started by politieguy Aug 12 2015 05:46 AM

2 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

politieguy

[GLOBAL: userInfoPane.html]
politieguy
  • Observer

  • 2 posts
  • Corona SDK

I'm making an app which measures height/depth with the accelerometer of a phone, but I'm having difficulty setting it up. Can anyone help me by giving me some code? 

 

Thanks in advance.



[TOPIC: post.html]
#2

FearTec

[GLOBAL: userInfoPane.html]
FearTec
  • Contributor

  • 218 posts
  • Corona SDK

Height/depth?

[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,263 posts
  • Enterprise

The accelerometer measures current movement. It can measure your phone moving up and down. But not altitude (height, depth). For that you would use the built in barometer, but Corona SDK doesn't have access to that and I'm not sure how accessible it is from native.  The GPS can also give you altitude information, if you have access to the GPS satellites.  Sometime's location services will gave location information from WiFi routers which won't have height information.

 

Rob




[topic_controls]
[/topic_controls]