I am using arduino uno for motor controlling using PWM method . pin number 3 and 11 for one motor and 5 and 6 other motor ( OC0A and OC0B ) registers . Now I wanted to upload same program for arduino mega 2560 . My question is . Can I use same program with MEGA without changing anything
The way I write my code is to define all the pins at the start of the code. For example pin 6 is light dimmer. I would state const Light_Dim = 6; later when I need to change pin numbers my code stays the same i just change the 6 to the new pin number. I am not a C programmer by trade I did good old fashion Assembler, that worked great there and It also works in the Arduino IDE.
Good Luck & Have Fun!
Gil