Problem wth enum();

I’m writing a bit of code to control an electric window on a car.

It’s a bog standard FSM.

The first few lines are as follows - just settng things up.

#include <EEPROM.h>

#include "timer.h"


// the action states

enum states {idle, going_up, going_down, door_opened};
byte state;
bool statechange;    //  you'll see why I need these


//  Project specific limits and startpoints

#define interval 10  // clock for timers in mS


// the window states

enum window_states ( up, down, up_a_bit, down_a_bit, dunno );
byte window_state;

etc etc.

The compiler grumbles : quote

Arduino: 1.6.9 (Windows XP), Board: “Arduino Nano, ATmega328”

Using library EEPROM at version 2.0 in folder: E:\Documents and Settings\afh\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.10\libraries\EEPROM
exit status 1
use of enum ‘window_states’ without previous declaration

I’m puzzled - it’s quite happy with many other enums…

Any ideas?

Allan

Looks like the wrong brackets

enum window_states ( up, down, up_a_bit, down_a_bit, dunno );

...R

Nope - tried re-writing that line completely ,to no effect.

Allan

Sorry - tried again. You were quite right. It's hard to see the difference between ( and { on my screen in the IDE

allanhurst:
Sorry - tried again. You were quite right. It's hard to see the difference between ( and { on my screen in the IDE

I have not used the IDE editor for a long time. I use Geany

...R

Yup - it was reading those parenthethis as some sort of constructor invocation.