水平仪方向传感器加速度计

发布于 2024-12-27 15:27:21 字数 98 浏览 1 评论 0原文

我正在开发水平仪。 目前我使用加速度计的 x 和 y 值。 我不使用 z 值。 一般来说,它可以工作,但不是很顺利。

使用方向传感器或两者都使用会是更好的解决方案吗?

I am developing a spirit level.
Currently I use the x and y values of the accelerometer.
I do not use the z value.
In general it works, but it isnt very smooth.

Would it be a better solution to use the orientation sensor or maybe both?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧时浪漫 2025-01-03 15:27:21

我使用的解决方案是一个比例因子,这就是 midoalageb 建议的。我使用 0.5 的比例因子,因此传感器值基本上减半。这使得抖动不那么明显。这也会使气泡速度减慢一点,这样当倾斜设备时,气泡看起来就不会从一端跳到另一端。

The solution that I used was a scaling factor which is what midoalageb suggested. I use a scale factor of 0.5 so essentially the sensor value is cut in half. This makes the jitters less noticeable. This also slows the bubble down a bit so that it doesn't seem like it is jumping from one end to the other when tilting the device.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文