Measure distance

I have a float whiches value is a distance between two points. I want a println to appear only once when the distance is greater thah 100 for the first time. Does anyone know how to do this?

Tagged:

Answers

  • edited March 2018 Answer ✓

    Just set a boolean firstTime which is initially true to false when printing the for the first time :

    Check with

    if (firstTime) {
    
        println („greater“);
        firstTime=false; 
    
    }
    

    Define it before setup() :

    boolean firstTime = true; 
    

    Chrisir ;-)

Sign In or Register to comment.