L298N with Nano 33 BLE Sense motors not working

Hello everyone. I am trying to run four motors with L298N. And I am using the code below stored in my Arduino Nano 33 BLE Sense. I cannot read 3.3 V or 5 volt between the input pins and ground. So I thought the problem is about my code activating the arduino and haven't reached the motor driver yet. Is there anyone who has an idea what is the problem?

int enB=23;
int in1=20;
int in2=22;
int in3=24;
int in4=25;

void setup() {
  pinMode(enA, OUTPUT);
  pinMode(enB, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
}

void loop() {
  
  delay(2000);
  analogWrite(enA, 40);
  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);

  delay(2000);
  analogWrite(enB, 40);
  digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH);

}




Hi, @fellasfellas
Welcome to the forum.

I don't know much about the BLE but the pinout diagram does not have 20, 21, 24, 25;

Tom.... :smiley: :+1: :coffee: :australia:

I actually put the pin numbers according to datasheet below.

Hi, @fellasfellas

The IDE recognises the D2, D3, D4, A0, A1 pins.
You can assign pin D2 with

pinmode(PinIn, 2);

You don't need the D.
However its best to keep the A in A0, A2 when assigning analog input pins.

This document is for the 33 BLE.
https://docs.arduino.cc/tutorials/nano-33-ble-sense/cheat-sheet/

Tom.... :smiley: :+1: :coffee: :australia:

enA?

now i can read the 3.3 volt value on multimeter between the pins and ground. thank you. but i have a further question. the source is instantly decreases from 12 volt to 3.5 volt and the motors are still not working. you have any idea?

thank you.

hello. it is the output for arranging the speed of motors in1 and in2. is there something wrong i've missed?

I don't see it defined in the code, only enB.

If your power supply display is dropping, you may have the current limit set too low.
What is it set at now?

Have you got your machine lifted up so the wheels just spin?

Tom.... :smiley: :+1: :coffee: :australia:

oh sorry, i coppied it incorrectly to here. there is enA in the actual code.

there is a vague sound coming from the motors and i lifted them up but they don't spin.

The current limit set at 21mA now. what should i set it at?

thank you so much.

Please post the actual code, otherwise we can only guess how you have things connected and what your code actually does.

Set the current to 1A and analogwrite to 255

it worked! i thank you so much!

You are welcome