kopia lustrzana https://github.com/alanesq/esp32cam-demo
Update ESP32cam-demo.ino
rodzic
338bec9ce4
commit
0b5a34f011
|
@ -5,6 +5,8 @@
|
||||||
*
|
*
|
||||||
* Tested with ESP32 board manager version 3.0.2
|
* Tested with ESP32 board manager version 3.0.2
|
||||||
*
|
*
|
||||||
|
* NOTE: FLASH NOT WORKING - 30Sep24
|
||||||
|
*
|
||||||
* Starting point sketch for projects using the esp32cam development board with the following features
|
* Starting point sketch for projects using the esp32cam development board with the following features
|
||||||
* web server with live video streaming and RGB data from camera demonstrated.
|
* web server with live video streaming and RGB data from camera demonstrated.
|
||||||
* sd card support using 1-bit mode (data pins are usually 2,4,12&13 but using 1bit mode only uses pin 2)
|
* sd card support using 1-bit mode (data pins are usually 2,4,12&13 but using 1bit mode only uses pin 2)
|
||||||
|
@ -62,9 +64,9 @@
|
||||||
#include "wifiSettings.h" /* // delete this line //
|
#include "wifiSettings.h" /* // delete this line //
|
||||||
|
|
||||||
|
|
||||||
#define SSID_NAME "<WIFI SSID>"
|
#define SSID_NAME "<WIFI SSID HERE>"
|
||||||
|
|
||||||
#define SSID_PASWORD "<WIFI PASSWORD>"
|
#define SSID_PASWORD "<WIFI PASSWORD HERE>"
|
||||||
|
|
||||||
#define ENABLE_OTA 0 // If OTA updating of this sketch is enabled (requires ota.h file)
|
#define ENABLE_OTA 0 // If OTA updating of this sketch is enabled (requires ota.h file)
|
||||||
const String OTAPassword = "password"; // Password for performing OTA update (i.e. http://x.x.x.x/ota)
|
const String OTAPassword = "password"; // Password for performing OTA update (i.e. http://x.x.x.x/ota)
|
||||||
|
@ -96,6 +98,7 @@
|
||||||
void handleStream(); // stream live video (note: this can get the camera very hot)
|
void handleStream(); // stream live video (note: this can get the camera very hot)
|
||||||
int requestWebPage(String*, String*, int); // procedure allowing the sketch to read a web page its self
|
int requestWebPage(String*, String*, int); // procedure allowing the sketch to read a web page its self
|
||||||
void handleTest(); // test procedure for experimenting with bits of code etc.
|
void handleTest(); // test procedure for experimenting with bits of code etc.
|
||||||
|
void handleReboot(); // handle request to restart device
|
||||||
void brightLed(byte); // turn the onboard flash LED on/off with varying brightness
|
void brightLed(byte); // turn the onboard flash LED on/off with varying brightness
|
||||||
void setupFlashPWM(); // set up the PWM for the above flash
|
void setupFlashPWM(); // set up the PWM for the above flash
|
||||||
void handleData(); // the root web page requests this periodically via Javascript in order to display updating information
|
void handleData(); // the root web page requests this periodically via Javascript in order to display updating information
|
||||||
|
@ -108,7 +111,7 @@
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
|
|
||||||
char* stitle = "ESP32Cam-demo"; // title of this sketch
|
char* stitle = "ESP32Cam-demo"; // title of this sketch
|
||||||
char* sversion = "08Jul24"; // Sketch version
|
char* sversion = "30Sep24"; // Sketch version
|
||||||
|
|
||||||
#define WDT_TIMEOUT 60 // timeout of watchdog timer (seconds)
|
#define WDT_TIMEOUT 60 // timeout of watchdog timer (seconds)
|
||||||
|
|
||||||
|
@ -609,10 +612,12 @@ bool cameraImageSettings() {
|
||||||
void setupFlashPWM() {
|
void setupFlashPWM() {
|
||||||
#if defined (ESP_ARDUINO_VERSION_MAJOR) && ESP_ARDUINO_VERSION_MAJOR == 3
|
#if defined (ESP_ARDUINO_VERSION_MAJOR) && ESP_ARDUINO_VERSION_MAJOR == 3
|
||||||
// board manager v3
|
// board manager v3
|
||||||
ledcAttach(ledChannel, ledFreq, ledRresolution);
|
if (serialDebug) Serial.println("LED configured for v3 board manager");
|
||||||
|
ledcAttach(brightLED, ledFreq, ledRresolution); // was - ledcAttach(ledChannel, ledFreq, ledRresolution);
|
||||||
brightLed(brightLEDbrightness);
|
brightLed(brightLEDbrightness);
|
||||||
#else
|
#else
|
||||||
// board manager pre v3
|
// board manager pre v3
|
||||||
|
if (serialDebug) Serial.println("LED configured for pre v3 board manager");
|
||||||
ledcSetup(ledChannel, ledFreq, ledRresolution);
|
ledcSetup(ledChannel, ledFreq, ledRresolution);
|
||||||
ledcAttachPin(brightLED, ledChannel);
|
ledcAttachPin(brightLED, ledChannel);
|
||||||
brightLed(brightLEDbrightness);
|
brightLed(brightLEDbrightness);
|
||||||
|
|
Ładowanie…
Reference in New Issue