I am having a problem with the coding for the esp32 and DC motors with encoders. Most of the examples on the internet use a pid system that includes analogWrite (). However, esp32 doesn't support analogWrite() functions. Does anyone have experience with the esp32 and motor encoders? By the way I am connecting the motor using an L293D if that makes any difference.
I have the above mentioned motor that I would like to run in a clockwise and counterclockwise direction as well as have it go a certain amount then return the same amount. This is not for a forward, backward type of project like a robot or making two different motors correct to each other to drive straight. Mine is to raise and lower an object. I have it working with a simple JX180-370 motor but when it moves the amount designated by seconds in the code it is not consistent and that is why I am switching to one with an encoder.
I have tried the many encoder examples for general boards...compiling error. Then I tried the esp32 encoder library example...compiling error. The last error has to do with encoder.attachFullQuad not defined. This is just the example without any modifications so there must be something wrong with the library.
Anyways, any help or websites you can direct me to would be appreciated. I am kind of new at coding so I need an example then I can change to fit my needs.
I have the above mentioned motor that I would like to run in a clockwise and counterclockwise direction as well as have it go a certain amount then return the same amount. This is not for a forward, backward type of project like a robot or making two different motors correct to each other to drive straight. Mine is to raise and lower an object. I have it working with a simple JX180-370 motor but when it moves the amount designated by seconds in the code it is not consistent and that is why I am switching to one with an encoder.
I have tried the many encoder examples for general boards...compiling error. Then I tried the esp32 encoder library example...compiling error. The last error has to do with encoder.attachFullQuad not defined. This is just the example without any modifications so there must be something wrong with the library.
Anyways, any help or websites you can direct me to would be appreciated. I am kind of new at coding so I need an example then I can change to fit my needs.