Created
March 5, 2019 20:39
-
-
Save ddefb/32b408f8bfb452720b73a7d4cfc9ecb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double read_obstacle(){ | |
digitalWrite(A0, HIGH); | |
delayMicroseconds(15); | |
digitalWrite(A0, LOW); | |
uint32_t pulse_time = pulseIn(A1, HIGH); | |
double distance = 0.01715 * pulse_time; | |
return distance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment