This is code for the ESP32-CAM that implemements the use of the ld... radar in order to be used to turn
- Create a secrets.h file
- Add the following to your arduino IDE:
- Perform this fix https://forum.arduino.cc/t/https-webserver-with-external-library-esp32-https-server-on-esp32/912930
#define WIFI_SSID "your ssid"
#define WIFIPASS "your password"
#define WIFINAME "Presence Sensor"
#define NETWORKRANGE 1
#define LIGHTS_ARRAY {"lamp mac address", "lamp 2 mac address", "lamp 3 mac address"}NETWORKRANGE is the third block in your private ip (ex: 192.168.1.1 vs 192.168.0.1)
This programs normally into board.
here are the pintouts:
#define RADAR_RX_PIN 12
#define RADAR_TX_PIN 13
#define RADAR_OUT_PIN 2The code includes a very basic server with a few endpoints:
- /LED: turns on the front LED on the board
- /img: returns one photo from the camera
- /radar: returns radar info as a json (usefull for debugging)
You can read more and find the files for the case here