I need some suggestions as to what to try next.

I am trying to make an example sketch work and it works fine with an Arduino UNO. However when I try and make it work with a Feather Huzzah, it does not work. I did not forget to change the board.
Here is the sketch.
The only changes that I have made are to change the 6 pins so as to use the pins that are on the Feather. In fact, I have commented out everything to do with motor B and am just trying to make motor A work.
These are the things that I have tried on the Feather

  1. Make sure that the USB cable is ok. I can run the Blink program just fine. Question. Is it possible that Blink could run but the L298 program would fail ?
    I have double and triple checked the pin numbers. I used pins 14, 12, and 13 as it seems like they should work with a Feather.

Any suggestions ??
thanks

/*	
	L298N Motor Demonstration
	
*/
	

// Motor A

int enA = 14;
int in1 = 12;
int in2 = 13;

// Motor B

int enB = 9;
int in3 = 8;
int in4 = 7;

void setup()

{

  // Set all the motor control pins to outputs

  pinMode(enA, OUTPUT);
  pinMode(enB, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);

}

void demoOne()

{

  // This function will run the motors in both directions at a fixed speed

  // Turn on motor A

  digitalWrite(in1, HIGH);
  digitalWrite(in2, LOW);

  // Set speed to 200 out of possible range 0~255

  analogWrite(enA, 200);

  /* // Turn on motor B *******************************************************Commented out until 

  digitalWrite(in3, HIGH);
  digitalWrite(in4, LOW);

  // Set speed to 200 out of possible range 0~255

  analogWrite(enB, 200);

  delay(2000);

   // Now change motor directions

  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);  
  digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH); 

  delay(2000); */ Commented out until here ***************************************************************

  // Now turn off motors

  digitalWrite(in1, LOW);
  digitalWrite(in2, LOW);  
  digitalWrite(in3, LOW);
  digitalWrite(in4, LOW);

}

void demoTwo()

/* Demo2() is not used in the loop. */ ***************************************

{

  // This function will run the motors across the range of possible speeds
  // Note that maximum speed is determined by the motor itself and the operating voltage

  // Turn on motors

  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);  
  digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH); 

  // Accelerate from zero to maximum speed

  for (int i = 0; i < 256; i++)

  {

    analogWrite(enA, i);
    analogWrite(enB, i);

    delay(20);

  } 

  // Decelerate from maximum speed to zero

  for (int i = 255; i >= 0; --i)

  {

    analogWrite(enA, i);
    analogWrite(enB, i);

    delay(20);

  } 

  // Now turn off motors

  digitalWrite(in1, LOW);
  digitalWrite(in2, LOW);  
  digitalWrite(in3, LOW);
  digitalWrite(in4, LOW);  

}

void loop()

{

  demoOne();

  delay(1000);

  /* demoTwo();

  delay(1000); */

}

hextejas:
I am trying to make an example sketch work and it works fine with an Arduino UNO. However when I try and make it work with a Feather Huzzah, it does not work.

With 257 posts in the forum, one would expect you'd supply a better problem statement than "does not work".

One obvious different is that the Feather is a 3.3V device. Does your LM298 board support that? Within the IDE, pins 12, 13, 14 correspond to MIS0 (6), MOSI (7) and SCK (5)

gfvalvo:
With 257 posts in the forum, one would expect you'd supply a better problem statement than "does not work".

Let's see. Works fine = motor spins, doesn't work = motor doesn't spin.
Is that clear enough ?

blh64:
One obvious different is that the Feather is a 3.3V device. Does your LM298 board support that? Within the IDE, pins 12, 13, 14 correspond to MIS0 (6), MOSI (7) and SCK (5)

Blh64, humm I had not considered the 3.3v. I will have to take a look at that.
And to the best of my confused mind about which GPiO pin is which, I think (hope) that I have them correct..
Supposedly the numbers on the Feather board are what to use when using PWM .
I have another lengthy post all about that and the consensus seemed to say that what was printed, IE, 12, 13, and 14, is what is specified in the sketch.

hextejas:
Let's see. Works fine = motor spins, doesn't work = motor doesn't spin.
Is that clear enough ?

It is now, but that was not obvious earlier.

...R

Hi,

"Sketch works with UNO but not Feather Huzzar"
You need to check the pinout functions of both controller boards.


Tom... :slight_smile:

TomGeorge:
Hi,

"Sketch works with UNO but not Feather Huzzar"
You need to check the pinout functions of both controller boards.

Tom... :slight_smile:

Tom, would you agree that for the Feather, pins 12, 13, and 14 are useable ?

What is the power supply for your motors?

Hi,
I went looking for sample code for the Huzzah and yes 12,13,14 look good for PWM.
Instead of connecting the motor shield, can you connect some LEDs and current limit resistors to check that you have PWM control out of the pins?

Can you post a circuit diagram of both UNO and Huzzah projects please?

Tom... :slight_smile:

wildbill:
What is the power supply for your motors?

2 separate DC supplies.

  1. 6v battery
  2. 13v desktop.
    I checked that all the <-> neg are connected to gnd.

When I had the UNO in the circuit, the voltage to the motor was 4.8v, the voltage at the ENa pin was .8v
I know that ENa is PWM, so I dont know how to interpret the .8v. Is that an average ?
With the feather in, ENa is 0

TomGeorge:
Hi,
I went looking for sample code for the Huzzah and yes 12,13,14 look good for PWM.
Instead of connecting the motor shield, can you connect some LEDs and current limit resistors to check that you have PWM control out of the pins?

Can you post a circuit diagram of both UNO and Huzzah projects please?

Tom... :slight_smile:

Tom, it is the same circuit for both projects and I will see if I can find a diagram. Its not mine.
This from a previous quote.
" When I had the UNO in the circuit, the voltage to the motor was 4.8v, the voltage at the ENa pin was .8v "
" I know that ENa is PWM, so I dont know how to interpret the .8v. Is that an average ? "

No circuit diagram but I have this.

hextejas:
No circuit diagram

Why? It's usually necessary. At least 90% of the time, a schematic answers the question instantly.

Blh64, humm I had not considered the 3.3v. I will have to take a look at that.

So, did you take a look at that? What is supplying Vss for the module?

What I see in a data sheet for the L298N

Symbol Parameter Test Conditions Min. Typ. Max. Unit
VSS Logic Supply Voltage (pin 9) 4.5 5 7 V

int enB = 9;

Which pin is 9 on Huzzah?

aarg:
Why? It’s usually necessary. At least 90% of the time, a schematic answers the question instantly.

aarg, this is not my sketch. It is from a tutorial that was teaching how to use the L298. They did not have a schematic.

hextejas:
aarg, this is not my sketch. It is from a tutorial that was teaching how to use the L298. They did not have a schematic.

That's ok. We're not interested in their schematic anyway - we want to know how yours is wired up. Usually, the ask is that you draw it with paper and pencil and post a photo of it.

cattledog:
So, did you take a look at that? What is supplying Vss for the module?

What I see in a data sheet for the L298N

The VSS to the L298N comes from the desktop power supply (13v) and a battery (6v)

Well, I am trying to try different things with the Feather but The stoopid IDE is now giving me that it cannot find the USB device attached to the Feather.
I have posted another thread in installation and troublesome forum.
I just upgraded to 1.8.13 so maybe that had something to do with it.

Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
  File "/root/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/upload.py", line 65, in <module>
    esptool.main(cmdline)
  File "/root/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 2890, in main
    esp.connect(args.before)
  File "/root/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 483, in connect
    raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
_
the selected serial port _
 does not exist or your board is not connected

I think that maybe I will try and find an alternative to Arduino IDE, if one exists. Any recommendations ?

Well it seems that the Feather board has been fried somehow. I had thought that it might be the USB cable so I replaced that, but that was not the answer.
This board must be pretty sensitive as this must be about the 8th that I have destroyed.
Sheesh.
Anyhow I will consider this on hold for now, until I get a new board. I still need to figure out why it works with an UNO but not a Feather. Who knows, maybe it will start working with a healthy Feather.

thanks.