Skip to content

Instantly share code, notes, and snippets.

@maxpromer
Created March 17, 2017 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxpromer/b547c60ea82bcd1f5e68a6e57c45b201 to your computer and use it in GitHub Desktop.
Save maxpromer/b547c60ea82bcd1f5e68a6e57c45b201 to your computer and use it in GitHub Desktop.
/*
* 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