OK, I have striped the program down to this, with no resolution.
/**********************************************************************
#Includes
***********************************************************************/
#include <Arduino.h>
#include "Water_Level.h"
// #include "Switches.h"
/**********************************************************************
clSwitches CLASS
Handles the presses of the switches
***********************************************************************/
enum eSwitch_ST {
SW_Init_ST = 0,
SW_WaitingForNotPressed_ST,
SW_NotPressed_ST,
SW_Pressed_ST
};
class clOffsetSwitch
{
public:
eSwitch_ST Switch_ST;
ULONG Switch_HoldTime;
clOffsetSwitch();
void Run( void );
};
/**********************************************************************
Globals
*/
bool OffsetSwitchWasPressed;
/
Library functions
*/
/
#includes
***********************************************************************/
// #include "Switches.h"
/**********************************************************************
clOffsetSwitch CLASS
Handles the presses of the buttons
***********************************************************************/
clOffsetSwitch::clOffsetSwitch( ) {
Switch_ST = SW_Init_ST;
};
/**********************************************************************
clOffsetSwitch CLASS
Handles the running the buttons
***********************************************************************/
void clOffsetSwitch::Run( void ) {
switch ( Switch_ST ) {
case SW_Init_ST:
break;
case SW_WaitingForNotPressed_ST:
break;
case SW_NotPressed_ST:
break;
case SW_Pressed_ST:
break;
default:
// Switch_ST = SW_Init_ST;
break;
}
};
/**********************************************************************
Global Variables
***********************************************************************/
clOffsetSwitch OffsetCalSwitch();
/**********************************************************************
setup() function
Things done at startup
***********************************************************************/
void setup() {
}
/**********************************************************************
loop() function
Things done continuously, over and over
***********************************************************************/
void loop() {
OffsetCalSwitch.Run();
}
And an .H file of:
/**********************************************************************
#Includes
***********************************************************************/
#include <Arduino.h>
#include "Water_Level.h"
// #include "Switches.h"
/**********************************************************************
clSwitches CLASS
Handles the presses of the switches
***********************************************************************/
enum eSwitch_ST {
SW_Init_ST = 0,
SW_WaitingForNotPressed_ST,
SW_NotPressed_ST,
SW_Pressed_ST
};
class clOffsetSwitch
{
public:
eSwitch_ST Switch_ST;
ULONG Switch_HoldTime;
clOffsetSwitch();
void Run( void );
};
/**********************************************************************
Globals
*/
bool OffsetSwitchWasPressed;
/
Library functions
*/
/
#includes
***********************************************************************/
// #include "Switches.h"
/**********************************************************************
clOffsetSwitch CLASS
Handles the presses of the buttons
***********************************************************************/
clOffsetSwitch::clOffsetSwitch( ) {
Switch_ST = SW_Init_ST;
};
/**********************************************************************
clOffsetSwitch CLASS
Handles the running the buttons
***********************************************************************/
void clOffsetSwitch::Run( void ) {
switch ( Switch_ST ) {
case SW_Init_ST:
break;
case SW_WaitingForNotPressed_ST:
break;
case SW_NotPressed_ST:
break;
case SW_Pressed_ST:
break;
default:
// Switch_ST = SW_Init_ST;
break;
}
};
/**********************************************************************
Global Variables
***********************************************************************/
clOffsetSwitch OffsetCalSwitch();
/**********************************************************************
setup() function
Things done at startup
***********************************************************************/
void setup() {
}
/**********************************************************************
loop() function
Things done continuously, over and over
***********************************************************************/
void loop() {
OffsetCalSwitch.Run();
}
I am getting an error message:
0_01\Water_Level_R0_01\Water_Level_R0_01.ino: In function 'void loop()':
C:\Users\jacks\OneDrive\ERG\Water Level\Design\Software\Rev 0_01\Water_Level_R0_01\Water_Level_R0_01.ino:112:21: error: request for member 'Run' in 'OffsetCalSwitch', which is of non-class type 'clOffsetSwitch()'
OffsetCalSwitch.Run();
^~~
exit status 1
Compilation error: request for member 'Run' in 'OffsetCalSwitch', which is of non-class type 'clOffsetSwitch()'
Obviously, the project is much bigger, but this fails for me.
Do you get the same?
What am I doing wrong?