I have a value of Android accelerometer x axis, and on every 0.18 change of that value, the value of az should also be incrementally/decrementally changed by 5
for example:
at x=0, az=0
at x=0.18, az=5
at x=0.36, az=10
if the value of x back to 0.18, so az value must also be back to 5 (that means x and az are synchronized)
How should I implement this logic into codes?
PS: I expect “for”, “if”, or maybe “while” statements here
Sorry for my bad English. Thank you in advance
I presume you have some way of continually monitoring the
xvalue. In which case, pseudo-code: