Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 912 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 912 Bytes

Ultrino

Arduino library for the HC-SR04 ultrasonic sensor. The distance is returned in centimeters.

Linux: : Build Status

Installation

For a simple, easy installation download the repository as a zip file and follow the instructions on how to install an Arduino library from a zip file.

Example

The example below is also in the examples folder. The manifacturer recomends an interval of at least 60 milliseconds between readings.

#include <Ultrino.h>

Ultrino us(2,4);

void setup() {
  Serial.begin(9600);
  while (!Serial) {
  }
  Serial.println("Setup is done");
}

void loop() {
  Serial.print("Distance: ");
  Serial.println(us.getDistance());
  delay(60);	// Recommended by manufacturer
}