L298N Dual Motor Controller Enable Pin has power but motors not working
I found this thread for a similar problem,
I realized that my scratch (taken from here) wasn't able to works..
After many and many tries, I found that:
the scratch works only using Serial Plotter, and not using Serial monitor.
In my case it was not necessary to connect 5vout of L298N with arduino,
(clearly you need to connect ground to battery supply and to arduino ground too).
I don't know why the scratch works properly (make motors turn) only by Serial Plotter and it doesn't work by Serial monitor.
I really would like to understand it!! (if someone could explain this oddity I would be very grateful).
Hope this could help.
UPDATE:
I found why it doesn't work on Serial monitor..
In the serial monitor, by using:
int inByte = Serial.read();

you must select &quot;no line ending&quot;.
:)
it's always human error!
NOTE:
the 5V pin let to power Raspberry and this is it use.
I don't know if that solution should be risky..
In the Datasheet it's said:

A non-inductive 100nF capacitor must be connected between this pin and ground

I searched about this solution on Raspberry but, after many readings, I just don't know if this could be a safe solution to power it.
I can't suggest it as a secure way.