incompatibility of Arduino Uno Rev. 3 and motor shield L298

Guys, we are frustrated. As a first project we try to get a motor run with the arduino Uno rev. 3 ATmega328 and motorshield L298.

we programmed a start of motor and a brake sequence in a loop.
Installed / upload and then we only hear a strong sound but no movement … what are we doing wrong?
we tried it with 6 V and with 7.5 volt … could it be that the motor shield is broken?
I tried it with 3 different UNO’s and every time the same…

we could have some help here …

(deleted)

@HMT

Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.

ok ok guys, probably it is the wrong forum as well:

const int MotorRpinA= 12;
const int MotorSpeedpinA= 3;
const int MotorBrakepinA=9;

const int MotorLpinB= 12;
const int MotorSpeedpinB= 11;
const int MotorBrakepinB=8;

const int VW = HIGH;
const int AW = LOW;

void setup() {
// motor A en B volle toeren

pinMode(MotorRpinA, OUTPUT);
pinMode(MotorSpeedpinA, OUTPUT);
pinMode(MotorBrakepinA, OUTPUT);

pinMode(MotorSpeedpinB, OUTPUT);
pinMode(MotorBrakepinB, OUTPUT);

Serial.begin(9600);// serial monitoring
}

void loop() {
//start motoren L en R met max speed
digitalWrite(MotorRpinA, AW);
Serial.println("richting aw");
analogWrite(MotorSpeedpinA, 10);// max. snelheid
Serial.println("Snelheid 10");
delay(5000);
digitalWrite(MotorBrakepinA, VW);
Serial.println("Remmen");
delay(2000);
}

Will move it for you.

Bob.

ballscrewbob:
Will move it for you.

Bob.

thanks!

hmm uploading of the picture .. even as 600 kb . no success yet .. will do it later ....

sorry for that, found out that we needed more power then the USB port cable ....

Still no details of what shield you are using. The code looks wrong for most of those I know.

And referring to the power as two or 2x2 doesn't help. 2x2 of WHAT?

And "the blue one" is completely meaningless.

You're making it really difficult to help.

Steve

@HMT

One of those links I provided earlier has a section on how to post pictures.
Please use the help provided to you.

Still no details of what shield you are using. (my first post / I do not have more info than that:

*** As a first project we try to get a motor run with the Arduino Uno rev. 3 ATmega328 and motorshield L298 ***.)

The code looks wrong for most of those I know. .....okay

1st the motors we have are crap.
2nd we have written a code ... in a loop (see here under) ....

the problem is that when starting the loop for the 2nd time the first block is ignored :frowning:

const int MotorRpinA= 12;
const int MotorSpeedpinA= 3;
const int MotorBrakepinA=9;

const int MotorLpinB= 13;
const int MotorSpeedpinB= 11;
const int MotorBrakepinB=8;

const int CCW = HIGH;//achteren
const int CW = LOW;//voorwarts

void setup() {
// motor A en B volle toeren

pinMode(MotorRpinA, OUTPUT);
pinMode(MotorSpeedpinA, OUTPUT);
pinMode(MotorBrakepinA, OUTPUT);

pinMode(MotorLpinB, OUTPUT);
pinMode(MotorSpeedpinB, OUTPUT);
pinMode(MotorBrakepinB, OUTPUT);

Serial.begin(9600);// serial monitoring
}

void loop() {
//start motoren L en R met max speed
//block 1
digitalWrite(MotorRpinA, LOW);
Serial.println("richting vw");
analogWrite(MotorSpeedpinA, 255);// max. snelheid
Serial.println("max snelheid R");
digitalWrite(MotorLpinB, LOW);
Serial.println("richting vw");
analogWrite(MotorSpeedpinB, 255);// max. snelheid
Serial.println("max snelheid L");

delay(5000);

digitalWrite(MotorBrakepinA, VW);
analogWrite(MotorSpeedpinA, 0);
Serial.println("Remmen R");
digitalWrite(MotorBrakepinB, VW);
analogWrite(MotorSpeedpinB, 0);
Serial.println("Remmen L");

delay(2000);

//block 2
//start motoren L en R met max speed achteruit

digitalWrite(MotorRpinA, HIGH);
Serial.println("richting aw");
analogWrite(MotorSpeedpinA, 255);// max. snelheid
Serial.println("Snelheid 200");
digitalWrite(MotorLpinB, HIGH);
Serial.println("richting aw");
analogWrite(MotorSpeedpinB, 255);// max. snelheid
Serial.println("Snelheid max aw");
delay(5000);

digitalWrite(MotorBrakepinA, AW);
analogWrite(MotorSpeedpinA, 0);
Serial.println("Remmen");
digitalWrite(MotorBrakepinB, AW);
analogWrite(MotorSpeedpinB, 0);
Serial.println("Remmen");
delay(2000);
return;
}

@HMT

We are trying to help but that needs your co-operation.

PICTURES !

CODE INSIDE CODE TAGS !

Just two of the things that are mentioned in those links I provided.

You have to help us to help you.
People will walk away from threads like this if the original poster wont help themself.

Can we get some help here :grin:

I tried to compile the code in #10; it tells me VW isn't declared.

How can anyone help if you post code that doesn't even compile.

OK, so then I saw you had changed VW and AW to CCW and CW between #3 and #10.... I changed them back and got it to compile. Nobody should have to mess around like that to just get code to compile: you should provide code that does.

const int VW = HIGH;
const int AW = LOW;

So THEN I edited in some serial prints to say it's at the start of block 1 or block 2, and I get this output:

        BLOCK 1
richting vw
max snelheid R
richting vw
max snelheid L
Remmen R
Remmen L
                            BLOCK 2
richting aw
Snelheid 200
richting aw
Snelheid max aw
Remmen
Remmen
           BLOCK 1
richting vw
max snelheid R
richting vw
max snelheid L
Remmen R
Remmen L
                            BLOCK 2
richting aw
Snelheid 200
richting aw
Snelheid max aw

So I'm not getting this problem:

the problem is that when starting the loop for the 2nd time the first block is ignored

@Jubukraa .. you are right sorry for the mess we changed it (vw/aw into english cw/ccw) but before posting we didn't changed everything.
The issue is that the serial editor shows everything perfect but that the motor doesn't do what the software says. Guess I have failure in this simple code....

where I brought for clearance block 1 and block 2 (because English isn't our mothertongue) in ... the loop runs well at the start and after reset, but when looping for the first time the whole block one is not transferred to the motor (motor does not turn but turns in block 2 as programmed).

thanks for your patience