ARDX DC Motor

int transistorPin = 9;

void setup()
{
pinMode(transistorPin, OUTPUT);
Serial.begin(9600);
}

void loop()
{
for(int i =0; i<255;i++)
{
analogWrite(transistorPin, i);
Serial.println(i);
}
for(int j = 255; j>0; j–)
{
analogWrite(transistorPin, j);
Serial.println(j);
}
}