ESP_IOT v2.5
IOT ESP Coding
StepperModule.cpp File Reference
#include "StepperModule.h"
#include "PTStepper.h"
Include dependency graph for StepperModule.cpp:

Go to the source code of this file.

Macros

#define FEED_STOPPED   0
 
#define SINGLE_FEED   1
 
#define AUTO_FEED   2
 
#define JACKPOT_FEED   3
 
#define FEED_INTERVAL   1000
 

Functions

void stepperModule_savePreference (int preferenceID, String preferenceValue)
 called to set a preference (which will be an identifier and a string, which can be converted to a number or boolean) More...
 
boolean getBuzzStatus_StepperModule ()
 returns the buzzer status More...
 
int getFeederType ()
 retreives the feeder type (versus grabbing a global variable) More...
 
void setup_StepperModule ()
 called on setup() More...
 
void stepperModule_ProcessClientCmdFinal (char cmd)
 the Blink the LED - and it will use the latest BUZZER status (so MQTT could set buzzer on.. then call this) More...
 
void loop_StepperModule ()
 the main loop fro the StepperModule. This used be called FeederStateMachine() More...
 

Variables

int _feedState = FEED_STOPPED
 
int _feedsPerJackpot = 3
 
int _feedCount = _feedsPerJackpot
 
unsigned long feedPreviousMillis = 0
 

Macro Definition Documentation

◆ AUTO_FEED

#define AUTO_FEED   2

Definition at line 29 of file StepperModule.cpp.

◆ FEED_INTERVAL

#define FEED_INTERVAL   1000

Definition at line 36 of file StepperModule.cpp.

◆ FEED_STOPPED

#define FEED_STOPPED   0

Definition at line 27 of file StepperModule.cpp.

◆ JACKPOT_FEED

#define JACKPOT_FEED   3

Definition at line 30 of file StepperModule.cpp.

◆ SINGLE_FEED

#define SINGLE_FEED   1

Definition at line 28 of file StepperModule.cpp.

Function Documentation

◆ getBuzzStatus_StepperModule()

boolean getBuzzStatus_StepperModule ( )

returns the buzzer status

retrieves the buzzer status

Definition at line 43 of file StepperModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFeederType()

int getFeederType ( )

retreives the feeder type (versus grabbing a global variable)

retreives the feeder type, UNO or MINI

Definition at line 50 of file StepperModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loop_StepperModule()

void loop_StepperModule ( )

the main loop fro the StepperModule. This used be called FeederStateMachine()

the main loop for the StepperModule (this is the FeederStateMachine)

Definition at line 110 of file StepperModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_StepperModule()

void setup_StepperModule ( )

called on setup()

Definition at line 56 of file StepperModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stepperModule_ProcessClientCmdFinal()

void stepperModule_ProcessClientCmdFinal ( char  cmd)

the Blink the LED - and it will use the latest BUZZER status (so MQTT could set buzzer on.. then call this)

SerialDebug.println("Valid Commands: "); SerialDebug.println(" H == help, this message"); SerialDebug.println(" 0x0, s, c == Single Feed "); SerialDebug.println(" a == AutoFeed "); SerialDebug.println(" u == UNO "); SerialDebug.println(" m == MINI "); SerialDebug.println(" L == Tumbler "); SerialDebug.println(" B == Buzzer On"); SerialDebug.println(" b == Buzzer Off"); SerialDebug.println(" G == Gateway On"); SerialDebug.println(" g == gateway Off"); SerialDebug.println(" R == clean credentials"); SerialDebug.println(" O == OTA update"); SerialDebug.println(" X == clean EPROM"); SerialDebug.println(" T == tilt on"); SerialDebug.println(" t == tilt off"); processes a single character command from BLE (or from MQTT converted to a single character)

NOTE: There are other commands, but these are only the ones that require a action. TODO: make these "events" on the setting of those values. eg. register for stepperValue true or false, etc.. They would be invoked from the 'savePreferencesBoolean' call.

Definition at line 66 of file StepperModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stepperModule_savePreference()

void stepperModule_savePreference ( int  preferenceID,
String  preferenceValue 
)

called to set a preference (which will be an identifier and a string, which can be converted to a number or boolean)

StepperModule

Variable Documentation

◆ _feedCount

int _feedCount = _feedsPerJackpot

Definition at line 34 of file StepperModule.cpp.

◆ _feedsPerJackpot

int _feedsPerJackpot = 3

Definition at line 33 of file StepperModule.cpp.

◆ _feedState

int _feedState = FEED_STOPPED

Definition at line 32 of file StepperModule.cpp.

◆ feedPreviousMillis

unsigned long feedPreviousMillis = 0

Definition at line 37 of file StepperModule.cpp.