ソースを参照

Photo command test

Erwin Ried 3 年 前
コミット
bfedb0bb29
3 ファイル変更49 行追加32 行削除
  1. 11 0
      esp32_marauder/CommandLine.cpp
  2. 37 31
      esp32_marauder/CommandLine.h
  3. 1 1
      esp32_marauder/configs.h

+ 11 - 0
esp32_marauder/CommandLine.cpp

@@ -178,6 +178,17 @@ void CommandLine::runCommand(String input) {
       Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
     }
   }
+  #ifdef ESP32_CAM
+    else if (cmd_args.get(0) == CAM_PHOTO) {
+      pinMode(4,OUTPUT);
+      digitalWrite(4,HIGH);
+      delay(200);
+      digitalWrite(4,LOW);
+      Serial.println("Saved to SD");
+      
+    }
+  #endif
+  
   // Clear APs
   else if (cmd_args.get(0) == CLEARAP_CMD) {
     int ap_sw = this->argSearch(&cmd_args, "-a"); // APs

+ 37 - 31
esp32_marauder/CommandLine.h

@@ -4,9 +4,9 @@
 #include "configs.h"
 
 #ifdef HAS_SCREEN
-  #include "MenuFunctions.h"
-  #include "Display.h"
-#endif 
+#include "MenuFunctions.h"
+#include "Display.h"
+#endif
 
 #include "WiFiScan.h"
 #include "Web.h"
@@ -14,8 +14,8 @@
 #include "settings.h"
 
 #ifdef HAS_SCREEN
-  extern MenuFunctions menu_function_obj;
-  extern Display display_obj;
+extern MenuFunctions menu_function_obj;
+extern Display display_obj;
 #endif
 
 extern WiFiScan wifi_scan_obj;
@@ -29,6 +29,12 @@ extern const String PROGMEM version_number;
 
 //// Commands
 
+#ifdef ESP32_CAM
+// Camera functions
+const char PROGMEM CAM_PHOTO[] = "photo";
+const char PROGMEM CAM_STREAM[] = "stream";
+#endif
+
 // Admin
 const char PROGMEM CH_CMD[] = "channel";
 const char PROGMEM CLEARAP_CMD[] = "clearlist";
@@ -116,32 +122,32 @@ class CommandLine {
     int argSearch(LinkedList<String>* cmd_args, String key);
 
     const char* ascii_art =
-    "\r\n"
-    "              @@@@@@                        \r\n"
-    "              @@@@@@@@                      \r\n"
-    "              @@@@@@@@@@@                   \r\n"
-    "             @@@@@@  @@@@@@                 \r\n"
-    "          @@@@@@@      @@@@@@@              \r\n"
-    "        @@@@@@            @@@@@@            \r\n"
-    "     @@@@@@@                @@@@@@@         \r\n"
-    "   @@@@@@                      @@@@@@       \r\n"
-    "@@@@@@@              @@@@@@@@@@@@@@@@       \r\n"
-    "@@@@@                 @@@@@@@@@@@@@@@       \r\n"
-    "@@@@@                   @@@@@@@             \r\n"
-    "@@@@@                      @@@@@@           \r\n"
-    "@@@@@@                       @@@@@@@        \r\n"
-    "  @@@@@@                        @@@@@@@@@@@@\r\n"
-    "    @@@@@@@                          @@@@@@ \r\n"
-    "       @@@@@@                     @@@@@@    \r\n"
-    "         @@@@@@@                @@@@@@      \r\n"
-    "            @@@@@@           @@@@@@         \r\n"
-    "              @@@@@@@      @@@@@@           \r\n"
-    "                 @@@@@@ @@@@@@              \r\n"
-    "                   @@@@@@@@@                \r\n"
-    "                      @@@@@@                \r\n"
-    "                        @@@@                \r\n"
-    "\r\n";
-        
+      "\r\n"
+      "              @@@@@@                        \r\n"
+      "              @@@@@@@@                      \r\n"
+      "              @@@@@@@@@@@                   \r\n"
+      "             @@@@@@  @@@@@@                 \r\n"
+      "          @@@@@@@      @@@@@@@              \r\n"
+      "        @@@@@@            @@@@@@            \r\n"
+      "     @@@@@@@                @@@@@@@         \r\n"
+      "   @@@@@@                      @@@@@@       \r\n"
+      "@@@@@@@              @@@@@@@@@@@@@@@@       \r\n"
+      "@@@@@                 @@@@@@@@@@@@@@@       \r\n"
+      "@@@@@                   @@@@@@@             \r\n"
+      "@@@@@                      @@@@@@           \r\n"
+      "@@@@@@                       @@@@@@@        \r\n"
+      "  @@@@@@                        @@@@@@@@@@@@\r\n"
+      "    @@@@@@@                          @@@@@@ \r\n"
+      "       @@@@@@                     @@@@@@    \r\n"
+      "         @@@@@@@                @@@@@@      \r\n"
+      "            @@@@@@           @@@@@@         \r\n"
+      "              @@@@@@@      @@@@@@           \r\n"
+      "                 @@@@@@ @@@@@@              \r\n"
+      "                   @@@@@@@@@                \r\n"
+      "                      @@@@@@                \r\n"
+      "                        @@@@                \r\n"
+      "\r\n";
+
   public:
     CommandLine();
 

+ 1 - 1
esp32_marauder/configs.h

@@ -363,7 +363,7 @@
   #endif
 
   #ifdef ESP32_CAM
-    #define SD_CS 15
+    #define SD_CS 12 // not 4, not 15, not 13
   #endif
   //// END SD DEFINITIONS