ESP_IOT v2.5
IOT ESP Coding
M5Atom_CameraModuleClass.cpp
Go to the documentation of this file.
1//
2// M5Atom_CameraModuleClass.cpp
3// ESP_IOT
4//
5// Created by Scott Moody on 8/16/25.
6//
7
9
10
11#ifdef USE_CAMERA_MODULE
12#include "../CameraModule/CameraModule.h"
13#endif
14
16{
17 SerialDebug.printf("M5Atom_CameraModuleClass init %s\n", config);
18
19}
20
21
22//! Data members of class
23//! Generic config info .. specific the the sensor type
24
25//!starts the PTStepper
27{
28
29}
30
31//!setup the PTStepper
33{
34#ifdef USE_CAMERA_MODULE
35 //! call setup from CameraModule
36 setup_CameraModule();
37#endif
38
39 //! 8.16.25 register our PIN use
40 registerPinUse_mainModule(4, "CameraPinOut", "M5Atom_CameraModuleClass", false);
41
42 SerialDebug.println("M5Atom_CameraModuleClass.setup");
43}
44
45//! stops motor
47{
48}
49
50//!setup the PTStepper
52{
53#ifdef USE_CAMERA_MODULE
54 loop_CameraModule();
55#endif
56}
57
58//! ATOM specific
59
60//! these are from the ATOM
61
62//! 8.28.23 Adding a way for others to get informed on messages that arrive
63//! for the set,val
64//! 12.27.23 support setName == "QRCode"
65//! 1.10.24 if deviceNameSpecified then this matches this device, otherwise for all.
66//! It's up to the receiver to decide if it has to be specified
67void M5Atom_CameraModuleClass::messageSetVal_M5AtomClassType(char *setName, char* valValue, boolean deviceNameSpecified)
68{
69 //messageSetVal_M5CameraModule(setName, valValue, deviceNameSpecified);
70 SerialDebug.printf("camera.set %s val: %s\n", setName, valValue);
71
72}
73
74//! 12.28.23, 8.28.23 Adding a way for others to get informed on messages that arrive
75//! for the send -
76void M5Atom_CameraModuleClass::messageSend_M5AtomClassType(char *sendValue, boolean deviceNameSpecified)
77{
78 SerialDebug.printf("camera.send: %s nameSpecified=%d\n", sendValue, deviceNameSpecified);
79 if (containsSubstring(sendValue, "capture") || containsSubstring(sendValue, "CAPTURE"))
80 {
81 SerialDebug.println("takePicture_CameraModule");
82#ifdef USE_CAMERA_MODULE
83 takePicture_CameraModule();
84#endif
85 }
86}
87
88//! BUTTON PROCESSING abstraction
89//!short press on buttonA (top button)
91{
92 //buttonA_ShortPress_M5CameraModule();
93}
94//!long press on buttonA (top button)
96{
97 //buttonA_LongPress_M5CameraModule();
98}
99
100//! for status
102
103//!returns a string in in URL so: status&battery=84'&buzzon='off' } .. etc
104//!starts with "&"*
106{
107 //! 8.4.25 add k=GPS
108 sprintf(_cameraStatusBuffer,"camera=on");
109 return (char*)_cameraStatusBuffer;
110}
111
112//!returns a string in in JSON so: status&battery=84'&buzzon='off' } .. etc
113//!starts with "&"*
115{
116 sprintf(_cameraStatusBuffer,"'camera':'on'");
117 return (char*)_cameraStatusBuffer;
118}
119
char _cameraStatusBuffer[100]
for status
void registerPinUse_mainModule(long pin, String pinName, String moduleName, boolean isI2C)
bool containsSubstring(String message, String substring)
check if the string contains the other string. This is a poor man's grammer checker
Definition: MainModule.cpp:396
void messageSetVal_M5AtomClassType(char *setName, char *valValue, boolean deviceNameSpecified)
ATOM specific.
void start_M5AtomClassType()
starts the PTStepper
void messageSend_M5AtomClassType(char *sendValue, boolean deviceNameSpecified)
M5Atom_CameraModuleClass(char *config)
constructor
void buttonA_LongPress_M5AtomClassType()
long press on buttonA (top button)
void loop_M5AtomClassType()
setup the PTStepper
void setup_M5AtomClassType()
setup the PTStepper
An mostly virtual class.