Go Down

Topic: Autonomous Car (Read 5 times) previous topic - next topic

jada

WEll you did wire up things corectly
And you Were right you didnt need that ground Extra And IS it Working  ;)

chizzad

#36
Dec 14, 2010, 04:30 pm Last Edit: Dec 14, 2010, 04:48 pm by chizzad Reason: 1
still not running. im at a lost considering my code and my wiring should both work. with other code i was trying i also made the led blink to see if the code was working at all and it was. i have no idea what to do as of right now. ive changed my wiring and coding twice with no success.

EDIT: im also going to get rid of the extra ground wire along with the two black wires to the left of it in the schematic because that side doesnt need ground because im not using it.

SECOND EDIT: im going to try a few things that will most likely not work (hard to be positive right now)
1. changed to a 9v
2. also im going to try to add simple LED code to see if thats getting sent to the board and being processed.

jada

well where is your code ? abnd i just notice that your post is in the exhibition forum  ;D

chizzad

hah sorry when i first made my account i just kind of came on looked quickly and made on. if a mod wants to move it that would be great. i just now wrote up this code which the led is blinking but no motor movement.

#define m1p1 3 //motor one pin one
#define m1p2 4 //motor one pin two
const int ledPin = 13;  
void setup()
{
 pinMode (m1p1,OUTPUT);
 pinMode (m1p2,OUTPUT);
 pinMode(ledPin, OUTPUT);
 
 blink(ledPin, 20, 100);
}
void loop()
{
 digitalWrite(m1p1,HIGH);
 digitalWrite(m1p2,LOW);
   // drive motors forward set  delay
 delay(10000);
 //now drive motors reverse both
 digitalWrite(m1p1,LOW);
 digitalWrite(m1p2,HIGH);
   delay(10000);
   
}

void blink(int whatPin, int howManyTimes, int milliSecs) {
   int i = 0;
   for ( i = 0; i < howManyTimes; i++) {
     digitalWrite(whatPin, HIGH);
     delay(milliSecs/2);
     digitalWrite(whatPin, LOW);
     delay(milliSecs/2);
   }
}

jada

Hmmm well but i see you use a enable pin in your schematic i guess pin 9 You need to put it high at all time to run the motors ! ( i didnt read the entire code )

Go Up