#include<ESP32Servo.h>
#include"LerEntAnalogica.h"
class ServoPot {
private:
int pinServo;
Servo servo;
LerEntAnalogica pot;
public:
ServoPot(int x): pinServo(x) {
servo.attach(pinServo);
pot(2);
}
int m() {
int val = pot.g();
val = map(val, 0, 4095, 0, 180);
return val;
}
};
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
ServoPot eudo(13);
int val1;
void loop() {
.write(val); // put your main code here, to run repeatedly:
delay(15); // this speeds up the simulation
}