PaulS:
You can create a class that link a particular motor and speed value.class motorWithSpeed
{
int motorPin;
int motorSpeed;
motorWithSpeed(int pin);
setSpeed(int speed);
int getSpeed();
};
You can create an instance of that class:
motorWithSpeed speedy(3);
You can make that motor change speed:
speedy.setSpeed(160);
You can later determine how fast the motor is going:
int speedySpeed = speedy.getSpeed();
Only the class instance maintains the speed.
OMG, I didn't think of using a class! (herpaderp) Thankyou paul! I will love you forever <3