coilwinder project

Hi Trying to verify the attached sketch for the esp32 devkit C board using the Arduino.

At line 95 I get the error:-

‘eState’ does not name a type

Any advice would be much appreciated.

I did not write this myself but came accross it via internet searches.
I have successfully uploaded other sketches to this board using Arduino ide.
Perhaps this one is not suitable.
Don

coilwinder.cpp (14.5 KB)

If you had properly posted the code file, people just might be able to spot the cause of the error.

But, if you do a search of the code file for 'eState' , what do you find, other than line 95?

Paul

Have a look at the guide to posting on the forum which is a sticky at the top of every section. If you post your code correctly between code tags then more people will see it and help. Nobody wants to download random files from someone they don’t know on the internet!

There is an ~9k limit on inline posts.

struct sMotion
{
  enum eState { IDLE, ACC, DEC, MAXSPD };
  eState state;
  int stepsUsed;
};

I don't know why the compiler doesn't recognize the enum as a type.

I'd try:

struct sMotion
{
  enum eState { IDLE, ACC, DEC, MAXSPD } state;
  int stepsUsed;
};

or maybe:

enum eState { IDLE, ACC, DEC, MAXSPD };
struct sMotion
{
  enum eState state;
  int stepsUsed;
};

or maybe:

typedef enum { IDLE, ACC, DEC, MAXSPD } eState;
struct sMotion
{
  eState state;
  int stepsUsed;
};

Thanks for the replies. I'll give those suggestions a try.
I'll know how to post next time but in this case I exceeded the 9k limit.
Don