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