简体   繁体   English

以加速度计读数模式触发事件

[英]Triggering an event with a pattern of accelerometer readings

I'm making an app that records accelerometer readings and when it recognizes a specific pattern (for example: 3 readings above a threshold in the span of 5 seconds), it triggers an event or a new activity. 我正在制作一个记录加速度计读数的应用程序,当它识别出特定模式时(例如:在5秒的跨度内超过阈值3个读数),它将触发一个事件或一个新活动。

My question is what's the best way to implement a method that constantly and consistently "looks" for this pattern? 我的问题是实现一种持续不断地“寻找”这种模式的方法的最佳方法是什么?

You need to use a service for that type of application. 您需要为该类型的应用程序使用服务。 Here is an example of someone creating a barometer data logger . 这是一个创建气压计数据记录器的示例。 There's not really any reason you couldn't use different sensors. 没有任何理由不能使用其他传感器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM