SONAR.INO in actual Master Branch:
//Sets the trigPin at High state for 10 micro secs sending a sound wave
digitalWrite(trigPinX, HIGH);
digitalWrite(trigPinX, LOW);
delayMicroseconds(10);
-->safer/more stable sequence (in consens with manufactures rerefence design):
digitalWrite(trigPinX, LOW); // prepare "clean" transition to HIGH
delayMicroseconds(2);
digitalWrite(trigPinX, HIGH);
delayMicroseconds(10); // set HIGH for >= 10ms
digitalWrite(trigPinX, LOW);
SONAR.INO in actual Master Branch:
//Sets the trigPin at High state for 10 micro secs sending a sound wave digitalWrite(trigPinX, HIGH); digitalWrite(trigPinX, LOW); delayMicroseconds(10);
-->safer/more stable sequence (in consens with manufactures rerefence design):
digitalWrite(trigPinX, LOW); // prepare "clean" transition to HIGH delayMicroseconds(2);
digitalWrite(trigPinX, HIGH); delayMicroseconds(10); // set HIGH for >= 10ms digitalWrite(trigPinX, LOW);