事件驱动标志"沥青"在应用发明2 [英] Event driven sign with "pitch" in App Inventor 2

查看:219
本文介绍了事件驱动标志"沥青"在应用发明2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我是新来的应用程序Inventor2工具,我有一个小问题,试图获得一个间距值触发标签的可见性。

Since I'm new to App Inventor2 tool, I'm having a little issue trying to get a "pitch" value to trigger the visibility of a label.

我需要有一个标签被显示的时候,AccelerometerSensor,达到-30或30度点。要做到这一点我使用了zAccel值,并在横向模式下的应用程序运行,搭配上Android设备右侧的主页按钮。

I need to have a label being shown when the "AccelerometerSensor", reaches the -30 or 30 degrees point. To make this happen I'm using the "zAccel" value and the app runs in landscape mode, with the home button on the right side of the android device.

下面的图像显示,到目前为止我用,没有太多成功的块,作为警告是可见的所有时间:

The following image shows the blocks I've used so far, without much success, as the "Warning" is visible all the time:

与块或在所使用的逻辑的线索任何帮助,将大大AP preciated。谢谢大家提前为您的时间和答案。

Any help with a block or a clue in the logic used, will be much appreciated. Thank you all in advance for your time and answers.

推荐答案

让我提供我的意见给予像现在一样的答案:

let me provide my given comments as answer now:

您应该使用> 30 < -30 来代替,因为否则如果语句总是真正。结果
此外,我想补充一个其他语句为false 重新设置警示回。如果你不这样做,一旦警告是可见的,它会保持可见。

You should use >30 or <-30 instead, because else the if statement always is true.
Also I would add an else statement to set the warning back to false again. If you do not do this, once the warning is visible, it will stay visible.

这篇关于事件驱动标志&QUOT;沥青&QUOT;在应用发明2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆