Page 1 of 1

Passing data of captured image in esp32-cam to function in .cpp file

Posted: Wed Oct 27, 2021 11:45 am
by nataly
Hi everyone, I have this rr.cpp file

Code: Select all

#include <iostream>
using namespace std;
#include <fstream>
#include <string>
#include <Arduino.h>
//------------------------------------------
void dosome()
{
  ifstream fin("read.txt");     
  ofstream fcom("write.txt");
//Complete the rest of the code 
}
and this rr.h file

Code: Select all

#define rr_h
#include "Arduino.h"
class rr
{
  public:
  rr();
    void dosome();
    

};
and this is my .ino file ,

Code: Select all

// other config 
camera_fb_t * fb = NULL;
fb = esp_camera_fb_get();
now how can I passing fb = esp_camera_fb_get();
to the function in .cpp to write the output of fb = esp_camera_fb_get();
in file and then do some processing on txt file, can do that and how ?