Given that
int maximumDistance = 50; // distance Maximale acceptée (de 0-450 cm)
int minimumDistance = 0; // distance Minimale acceptée (en cm)
The code
if (cm > distanceObstacle || cm <= minimumDistance) {
Will always be true. Would you mean to AND those two statements and not OR them?
That is && in place of ||