Java/Android: Increment Algorithm
<p>I have a value of Android accelerometer x axis, and on every <strong>0.18</strong> change of that value, the value of <strong>az</strong> should also be incrementally/decrementally changed by <strong>5</strong> </p>

<p>for example:</p>

<p>at <code>x=0,    az=0</code></p>

<p>at <code>x=0.18, az=5</code></p>

<p>at <code>x=0.36, az=10</code></p>

<p>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)</p>

<p>How should I implement this logic into codes?</p>

<p>PS: I expect "for", "if", or maybe "while" statements here</p>

<p>Sorry for my bad English. Thank you in advance  </p>
