ESP_IOT v2.5
IOT ESP Coding
SG90ServoStepperClass.cpp
Go to the documentation of this file.
1//! \link SG90ServoStepperStepperClass
2//
3// SG90ServoStepperClass.cpp
4//
5//
6// Created by Scott Moody on 3/31/25.
7
9
10// from Dispense it calls getFeederType_mainModule()
11#include "StepperModule.h"
12
13//! see https://github.com/pablomarquez76/AnalogWrite_ESP32
14//! library: <analogWrite.h>
15//!
16//TODO ... #include <analogWrite.h>
17
18//#include "TimerDelayClass.h"
19//! create instance of the timer class
21
22//! default .. this could be set via Preferences (TODO)
24
25/******************stepper declarations******************************/
26
28{
29 SerialDebug.printf("SG90ServoStepperClass init %s\n", config);
31
32}
33
34//! This works with the ESP_M5
35
36const int IN1_PIN = 19;
37
38
39/************* Set all motor pins off which turns off the motor ************************************************/
41{
42
43}
44
45
46//! stop the motor
48{
49 SerialDebug.println("SG90ServoStepperClass::stop_MotorStepper");
50
51
52 //!user timer class instance
54}
55
57//! These are called from StepperModule
58//!Prepare motor controller
60{
61 SerialDebug.println("SG90ServoStepperClass::setup_MotorStepper");
62
63}
64
65
66//!This will advance the stepper clockwise once by the angle specified in SetupStepper. Example 16 pockets in UNO is 22.5 degrees
67//!This is the FEED message .. the comments mention the Stepper Motor .. which this isn't
69{
70 SerialDebug.println("SG90ServoStepperClass::start_MotorStepper");
71
72 //! ask the class wide method for the clockwise direction
73 // this->isClockwiseDirection();
74
75 SerialDebug.println("**************** SG90ServoStepperStepper::Starting SG90ServoStepper *******************");
76
77#define NEW_CODE__not_working
78#ifdef NEW_CODE
79 //!see https://github.com/pablomarquez76/AnalogWrite_ESP32
80 analogServo(IN1_PIN, 90); // Sends 90 degrees signal to pin 2 (0 degrees = 600ms 180 degrees = 2400ms at 50Hz)
81
82#endif
83
84 //! grab this value.
86
87 //! start the delay.. (which at .5 might not be needed...)
89
90 SerialDebug.println("**************** SG90ServoStepperStepper::Ending SG90ServoStepper *************");
91
92}
93
94
95//!loop the PTStepper (so timer can run)
97{
98 //!user timer class instance
100 {
101 SerialDebug.println("SG90ServoStepperClass::delayFinished");
102
103 this->stop_MotorStepper();
104 }
105
106}
float getPreferenceFloat_mainModule(int preferenceID)
called to set a preference (which will be an identifier and a string, which can be converted to a num...
#define PREFERENCE_STEPPER_ANGLE_FLOAT_SETTING
const int IN1_PIN
This works with the ESP_M5.
void clearPins_SG90ServoStepper()
float _delaySeconds_SG90ServoStepper_setting
default .. this could be set via Preferences (TODO)
TimerDelayClass * _timerDelayClass_SG90ServoStepperClass
SG90ServoStepperStepperClass
boolean _isSetup_SG90ServoStepper
An mostly virtual class.
void start_MotorStepper()
starts the SG90Servo
SG90ServoStepperClass(char *config)
constructor
void setup_MotorStepper()
setup the SG90Servo
void loop_MotorStepper()
setup the SG90Servo
void stop_MotorStepper()
stops motor
An concrete class.
void startDelay(float delayAmountSeconds)
starts delay calculation
boolean delayFinished()
whether the currently delay is finished, false if not running at all
void stopDelay()
stops delay