esp32-car/include/ultrasound.h

24 lines
366 B
C

#ifndef ULTRASOUND_H
#define ULTRASOUND_H
#include <Arduino.h>
#include <ESP32Servo.h>
struct UltrasonicPin
{
int trig;
int echo;
};
struct Ultrasonic
{
static UltrasonicPin pin;
static void init(UltrasonicPin pin, int servoPin);
static float getDistance();
static int servoPin;
static Servo servo;
static void servoControl(int angle);
};
#endif