This scenario demonstrates how to configure a timer in encoder mode to determine the rotation direction. Initialization phase: At main program start, the mx_system_init() function is called. It ...
const int enc_bottom_pin = 2; //Encoder pin that is not the middle const int enc_top_pin = 3; //Encoder pin that is not the middle (the other one) // Variables needed to read rotational encoder values ...