Skip to content

WPIRoboticsEngineering/Rangefinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rangefinder

Library for the ultrasonic rangefinder HC-SR04.

Installing the library (PlatformIO)

Add the following lines of code to your platformio.ini file:

lib_deps = 
     https://github.com/WPIRoboticsEngineering/Rangefinder

You are done.

Classes and functions

The main classes and functions provided by the library are listed below:

  • Rangefinder(uint8_t echo, uint8_t trig);
  • void init(void);
  • uint8_t checkPingTimer(void);
  • uint16_t checkEcho(void);
  • float getDistance(void);
  • void ISR_echo(void);

Datasheet

The datasheet of the HC-SR04 rangefinder can be found here.

Releases

No releases published

Packages

No packages published

Languages