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.
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:
<img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/H7qgy.png" data-original="https://i.stack.imgur.com/H7qgy.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />
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.Answer1:
let me provide my given comments as answer now:
You should use
<-30 instead, because else the
if statement always is
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.