Output from MKR1000

Hi,

Ive used an Arduino Uno to drive a single motor via an L298N Motor driver. I had the following simple config :

Motor Shield Arduino Uno
ENA Pin 10 (PWA) ~
IN1 Pin 8
IN2 Pin 9

VCC Pin GND on Arduino (If I dont do this the motors just hum)

Motor Shield
VCC 5V +
GND 5V -

Motor Shield
OUT3 Motor
OUT4 Motor

I plug the 5v -ve supply to GND on the arduino and GND on the L298N Motor shield, then plug the 5v +ve to the Motor Shield board.

All this works I wrote this code

int IN1 = 8;
int IN2 = 9;
int ENA = 10;
void setup()
{
pinMode(IN1,OUTPUT);
pinMode(IN2,OUTPUT);
pinMode(ENA,OUTPUT);
}
void loop()
{
analogWrite(ENA, 200);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
}

Now I swap the cod into a MKR 1000, and I use the same pins, but I get nothing out, no motor driving.

The wiring config is the same, what is wrong ? can anyone help me, I think I've probably made a fundamental mistake with the UNO and am getting lucky by it working ?

Thanks.

You may have already done this but just in case.

The pinouts for the MKR are different to the UNO

Link to pinouts.

You might also want to consider giving the motor board its own supply.
There are plenty of links on the net for doing this with only the ground being common to the Arduinos.

Hi,

I have my own PSU 5V that goes to the motor shield VCC and GND, I then run the GND from that to the arduino. I can see the outputs are correct for my motors ie low and high for IN1 and IN2, and HIGH for ENA (speed - I pass 200 in here from s/w and I use a PWM pin from the arudiono - analogue).

So I know my wiring is good (is swap an uno in and it works, I kow my software is good same thing swap an uno and it works), but when I put on the mkr1000 I can see the signals on the pins are still good (test tehm with a led), but it will not switch the motor shield ?

What is weird is if I hold the VCC 5 volt cable in my hand and press it, the motors come on !!!

It sounds like you have everything correct.

Fact that the motor runs if you hold the wire seems really odd and would indicate a faulty connection of some sort. Can you post good clear pictures of the set-up. It may help someone to see something.

If you can maybe also a copy of the code (using the code tags) that you use on the MKR.

It is also possible that the PWM frequency is too high. I don't know what frequency it is on the mkr1000, but I've seen people having trouble with this in the arduino Zero forum...