Error while compiling,, I want to know the solution and make sure that the code is correct

#include <WiFi.h>
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>
#include <Adafruit_Sensor.h>
#include <TinyGPS++.h>
#include <IRremote.h>
#include <driver/i2s.h>
#include <Adafruit_ZeroI2S.h>
#include <Arducam.h>


const char* ssid = "********";
const char* password = "**********";

#define BOT_TOKEN "**************"
#define CHAT_ID "*************"


#define CAM_SCL 21
#define CAM_SDA 22
#define CAM_VSYNC 23
#define CAM_HREF 25
#define CAM_D0 26
#define CAM_D1 27
#define CAM_D2 14
#define CAM_D3 12
#define CAM_D4 13
#define CAM_D5 15
#define CAM_D6 2
#define CAM_D7 0
#define CAM_RESET 4
#define CAM_PWDN 5

#define MIC_BCLK 33
#define MIC_WS 35
#define MIC_DATA 32
#define MIC_SEL 34

#define GPS_PPS 19
#define GPS_RXD 17 
#define GPS_TXD 16

#define IR_RECEIVER 18

#define TAKE_PHOTO 0x1FE807F
#define START_AUDIO 0x1FE40BF
#define STOP_AUDIO 0x1FE20DF
#define GET_LOCATION 0x1FEF807
#define ZOOM_IN 0xF30CBA04
#define ZOOM_OUT 0x58F8BCB2

ArduCAM cam;
WiFiClientSecure client;
UniversalTelegramBot bot(BOT_TOKEN, client);
IRrecv irrecv(IR_RECEIVER);
decode_results results;
TinyGPSPlus gps;
HardwareSerial gpsSerial(2);
double latitude = 0.0; 
double longitude = 0.0;
Adafruit_ZeroI2S mic;
    
   
        

void setup() {

Serial.begin(115200);

WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}

Serial.println("Connected to WiFi");

irrecv.enableIRIn();

    }

void loop() {

 
  if (irrecv.decode(&results)) {
    if (results.value == TAKE_PHOTO) {
      // Code to take photo with camera module
      Serial.println("Taking photo...");

      // Code to send photo to Telegram bot
      String photoFileName = "photo.jpg";
      cam.takePicture(photoFileName);
      bot.sendPhoto(CHAT_ID, photoFileName, "This is a photo");
    }

if (results.value == START_AUDIO) {
  // Code to start audio recording
  
  Serial.println("Starting audio recording...");
     mic.start();      
}

if (results.value == STOP_AUDIO) {  
  // Code to stop audio recording

  Serial.println("Stopping audio recording...");
  mic.stop();
            
  // Code to send audio clip to Telegram bot
    if (Arducam.isRecording()) {
      Arducam.stopRecording();
      String audioFileName = "audio.mp3";
      bot.sendAudio(CHAT_ID, audioFileName, "This is an audio clip");
    }
}


       if (results.value == GET_LOCATION) {
  Serial.println("Getting GPS location...");
  
// Code to get GPS location 
      if (gps.location.isValid()) {
        latitude = gps.location.lat();
        longitude = gps.location.lng();

        // Code to send location to Telegram bot
        String locationMessage = "Location: " + String(latitude, 6) + ", " + String(longitude, 6);
        bot.sendLocation(CHAT_ID, latitude, longitude);
      } else {
        Serial.println("Invalid GPS location");
      }
    }

       if (results.value == F30CBA04) {
  // Code to zoom in
  
  Serial.println("Zooming in...");

  // Zoom in by a certain number of steps
  zoomIn(7);
}

if (results.value == 58F8BCB2) {
  // Code to zoom out
  
  Serial.println("Zooming out...");

  // Zoom out by a certain number of steps
  zoomOut(7);
}
        
    irrecv.resume();
  }
  }         

First I don't use the Arduino IDE I'm working on Arduino Droid
These are the things I use ( The microcontroller is ESP32-WROVER-E
The camera is 2MP-OV2640 Camera Module
The microphone is Adafruit I2S MEMS Microphone
The GPS is Ublox-NEO-M8N GPS
and IR Receiver Module with remote control )
When I compile this code, a message appears to me that its content

sketch_sep11b.ino:92:11: error: 'class ArduCAM' has no member named 'takePicture'

All I want is to know a solution for this error and make sure that the code is valid and can be used with these components

The compiler is clearly telling you that the Arducam library does not have a 'takePicture' function and the older Arducam library does not have a 'takePicture' function.

The newer 'Mega' library does.

1 Like

I used the esp32cam library but another compile error appeared

/data/data/name.antonsmirnov.android.arduinodroid2/sdkEsp32/hardware/esp32/1.0.3/tools/sdk/include/esp32-camera/sensor.h:91:24: error: conflicting declaration 'typedef struct _sensor sensor_t'

No, you did not.

Well I want to use ArduCAM _Mega library
Can you help me
I want you to tell me how to add it and how to configure the camera because I tried a lot and unfortunately it shows more than one Eror message and most of it is

no matching function for call to 'Arducam_Mega::Arducam_Mega()'
ArduCam' does not name a type

Download Arducam_Mega and study the example that comes with it.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.