Encoders program


I’m trying to use the same motors, Nema 17 with encoders, and the arduino Mega in an school project. But I don’t know how to read the encoders and i can’t understand the code.

Could you please give a quick example of the program that i need to use to be able to read that the motors are moving correctly?

Thank you very much.

1 Like

Would loading the FarmBot firmware on to your Arduino work for your project? While there are topics in this forum discussing the FarmBot firmware, there are better resources than this forum for learning how to use and read encoders in general. I’d recommend using stepper motor and encoder Arduino libraries. Arduino Playground - Reading Rotary Encoders is a great place to get started.

Loading the same firmware could work, but i dont know how to send the commands.
I’m using serial prints rights now.

Thank you very much.

Hi Odracir93 I don’t know if you could solve your problem, I solved it with serial monitor on Arduino idle setting the serial comunication in NL/CR

send the comand
‘F22 P2 V1 Q0’