title: Processing java decrease until certain number
body: <p>I've got a variable called <code>tn</code>. I want to increase it until <code>50</code> and if it reaches 50 I want to decrease it back to 0 and if it reaches 0 I want to increase it again and <code>loop through it</code> </p>
  
  <pre><code>float tn = 0;
    tn += 0.1;
  
   if(tn &gt;= 50){
     tn -= 0.1;
   }
  </code></pre>
  
  <p>I've got this but now im stuck at <em>how</em> to decrease by 0.1 until it reaches 0 and if it reaches 0 <em>how</em> to increase it back to 50 and so on.</p>