Problem Running Motor using Arduino

Hello everyone,

I am trying to run a dc motor rated(5V)

Whenever i am connecting the motor between 5V and ground of the arduino it works.

Whenever i am connecting the motor between 3.3V and ground of the arduino it still works

when i try to do that using the following code it does not work neither with digital pins or analog ones

void setup() {
pinMode(A4,OUTPUT);
pinMode(A5,OUTPUT);
pinMode(9,OUTPUT);
pinMode(8,OUTPUT);
}

void loop() {
analogWrite(A5,255);
analogWrite(A4,0);
digitalWrite(9,HIGH);
digitalWrite(8,LOW);
}

it doesn't work between the combination of pins

(A5,A4) or (9,8) or (9,gnd) or (5V,8) or (A5,gnd) or (5V, A4) or (5V,8) etc.

Can anyone help me understand this

The pins can't provide enough current.
Stop your experiment before you damage something.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

This link may help.

Tom.... :slight_smile: