Wheel Problems

Good day! :) 

I've  been a member in this community just earlier, as well as I am in this field of electronics robotics.

I have my obstacle avoiding robot kit here with an arduino uno as the microcontroller. I encountered no problems in servos and HC-SR04, But I do with wheels. I used 293 to drive wheels on my desired direction, clockwise and counter-clockwise obviously. So here's my problem.

I wired them right and had no loose wirings on my DC Motor, I followed the pin configuration of L293D IC.

// code

const int LMA = 2;

const int LMB = 3;

const int RMA =4;

const int RMB =5;

 

void setup()

{

pinMode(LMA, OUTPUT);

pinMode(LMB, OUTPUT);

 pinMode(RMA, OUTPUT);

 pinMode(RMB, OUTPUT);

 }

 

void loop()

{

forward();

}

 

void forward();
{

digitalWrite(LMA, HIGH);

digitalWrite(LMB. LOW);

digitalWrite(RMA, HIGH);

digitalWrite(RMB, LOW);
}

 // assuming that there are still other codes for wheel direction

 

did I just do it right? 

but when I changed it to
backward();

the other wheel is not speening(left wheel), while the other one does.

then when I put this one,

void loop()

{

digitalWrite(LMA, HIGH);

digitalWrite(LMB, LOW);

}

then it is still not working, and I checked if there are any defects on that wheel, but it does work when I powered it without passing through the IC . and by the way, I gave it a power supply of approximately 6V ((4) 1.5V

 

thank you, and I'm hoping for your informations or answers to be shared. :)

- Ellimenopy :)   

L298 Sample Code

There should be a lot of sample code available for Arduino around the L298 chip. Look up any shield which uses it to see sample code and adapt it as needed. Two digital pins determine direction, while two PWM pins determine speed and are not just High / Low.

, and .
digitalWrite(LMB. LOW)

There’s a . Instead of a ,