AdolphSmith

9 years 8 months ago

// Define which pin to be used to communicate with Base pin of TIP120 transistor
int TIP120pin = 11; //for this project, I pick Arduino's PMW pin 11
void setup()
{
pinMode(TIP120pin, OUTPUT); // Set pin for output to control TIP120 Base pin
analogWrite(TIP120pin, 255); // By changing values from 0 to 255 you can control motor speed
}
 
void loop()
{
}

GroG

9 years 8 months ago

MRL's Motor service - http://myrobotlab.org/service/Motor - will work with 2 bit motor control - you currently have a single bit (speed) - but it should still work...   the other bit would be for direction - but you need an H-bridge to make that work.