Created
March 18, 2017 09:29
-
-
Save maxpromer/dfcce74f13b8914bc9422b5c989415b1 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
unsigned long __pulseIn(int pin, int lavel) { | |
while(digitalRead(pin) != lavel) ; | |
unsigned long time_s = 0; | |
while(digitalRead(pin) == lavel) { | |
delayMicroseconds(1); | |
time_s++; | |
} | |
return time_s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment