#pragma once

#include "GenericSensor.h"
#include <NewPing.h>


class SonarSensor : public GenericSensor {
private:
	NewPing sonar{ TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE };
public:
	SonarSensor(short id) : GenericSensor(id) {}

	unsigned int scan() {
		return sonar.convert_cm(sonar.ping_median());
	}
};
