Balancing robot for dummies

#Lauszus, thanks for your reply :slight_smile: I would to use every 1850 impulse of encoder, so my questions are:
1)How can i use the second encoder with other pin? because the first encoder are connected to a pin2 and pin3, that are the pins that i use with the interupt 0, and 1 respectively
2)using 1850 pulses per revolution, the speed of calculation in each period according to you would be slowed down with so many interruptions? In other words, can in a sampling step to have the time to read the speed, perform the calculations to obtain the PWM value to send the signal to the motor? thanks