Need help with port manipulation

Hi all,

I need help to reconfigure my robot pins with the code in the attachment which belong to OddBot , his code is for adjusting the speed of two motors of Rover 5, in his code he uses “port manipulation” which I am not familiar with it, he uses Port C to read encoders and run motors , I want to use his code but with port L , actually I changed my pins using port L but the motors and encoder don’t work, so please help me.

the original code of OddBot in the attachment named “OB1_Mini_Driver_V1_3”.

the code after I change port C to port L named “OB1”

Hint : I have Rover 5 with Arduino Mega and Motor Driver L298N. (3.12 KB) (3.02 KB)

Take a look at the pin mapping and see if you have connected everything correctly. When working with these mappings, check the mode set for those pins. You probably replaced PORTC for PORTL only. Check all the files for DDRD, replace them with DDRL and see if it works.