Hello!
Could someone help me make a code where I can control two motors and their speeds? Because I don't really know how to make one... I can control one motor and its speed with this code:
int value = 0; // variable to keep the actual value
int MotorPin = 9; // motor connected to digital pin 9
void setup()
{
// nothing for setup
}
void loop()
{
for(value = 0 ; value = 255;)
{
analogWrite(MotorPin, value); // sets the value (range from 0 to 255)
}
}