Skip to content

Instantly share code, notes, and snippets.

Last active May 29, 2016 23:17
What would you like to do?
#ifndef HCSR04_H
#define HCSR04_H
#include "Arduino.h"
#define CM 1
#define INCH 0
class HCSR04
HCSR04(uint8_t triggerPin, uint8_t echoPin);
HCSR04(uint8_t triggerPin, uint8_t echoPin, uint32_t timeout);
uint32_t timing();
uint16_t getDistance(uint8_t units, uint8_t samples);
uint8_t _triggerPin;
uint8_t _echoPin;
uint32_t _timeout;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment