I was getting started with programming a motor controller with the Arduino Uno, in this case it's a mega motor shield (the motor driver shield I'm using). The problem I have doing this is that I'm not sure what variables to use for the motor which is connected to two outputs labeled MA and MB. I used motorValue to set the speed previously and used motorPin for writing the speed with the Arduino and a breadboard, but I'm not sure what to use in place of that for the motor being connected to the driver shield outputs.

  • Do you care about both direction and speed?
    – Dave X
    Mar 8, 2016 at 13:49

1 Answer 1


Variables are just names assigned to numbers. The names, as far as your program is concerned, are completely meaningless.

It's the numbers you assign to the variables and, more importantly, what you do with those variables that is important.

Your shield seems to have jumpers to select what I/O pins perform which function, so you just need to write the software to control the chosen I/O pins in the right way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.