Created
March 17, 2017 17:38
-
-
Save maxpromer/b547c60ea82bcd1f5e68a6e57c45b201 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* | |
* Codeing By IOXhop : www.ioxhop.com | |
*/ | |
#define OUT_PIN A0 | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
unsigned int distance = analogRead(OUT_PIN); | |
// distance *= 3; // Uncomment, if use max 3m | |
Serial.print("Distance is "); | |
Serial.print(distance); | |
Serial.println(" cm."); | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment