Not declared in scope issue

it saying chiped_ not declared i put *** by it in the code so you can see
yes i did go to the memorysaver file and chose the right camera

// This program requires the ArduCAM V4.0.0 (or later) library and ArduCAM_Mini_5MP_Plus
// and use Arduino IDE 1.6.8 compiler or above
#include <Wire.h>
#include <ArduCAM.h>
#include <SPI.h>
//#include "memorysaver.h"

//This demo can only work on OV5642_MINI_5MP_Plus  platform.
//#if !(defined OV5642_MINI_5MP_PLUS)
//  #error Please select the hardware platform and camera module in the ../libraries/ArduCAM/memorysaver.h file
//#endif
#define BMPIMAGEOFFSET 66
const char bmp_header[BMPIMAGEOFFSET] PROGMEM =
{
  0x42, 0x4D, 0x36, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x28, 0x00,
  0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x03, 0x00,
  0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x1F, 0x00,
  0x00, 0x00
};
// set pin 7 as the slave select for the digital pot:
const int CS = 7;
bool is_header = false;
int mode = 0;
uint8_t start_capture = 0;
 ArduCAM myCAM( OV5642, CS );
uint8_t read_fifo_burst(ArduCAM myCAM);
void setup() {
// put your setup code here, to run once:
uint8_t vid, pid;
uint8_t temp;
#if defined(__SAM3X8E__)
  Wire1.begin();
  Serial.begin(115200);
#else
  Wire.begin();
  Serial.begin(921600);
#endif
Serial.println(F("ACK CMD ArduCAM Start! END"));
// set the CS as an output:
pinMode(CS, OUTPUT);
digitalWrite(CS, HIGH);
// initialize SPI:
SPI.begin();
 //Reset the CPLD
myCAM.write_reg(0x07, 0x80);
delay(100);
myCAM.write_reg(0x07, 0x00);
delay(100); 
while(1){
  //Check if the ArduCAM SPI bus is OK
  myCAM.write_reg(ARDUCHIP_TEST1, 0x55);
  temp = myCAM.read_reg(ARDUCHIP_TEST1);
  if (temp != 0x55){
    Serial.println(F("ACK CMD SPI interface Error! END"));
    delay(1000);continue;
  }else{
    Serial.println(F("ACK CMD SPI interface OK. END"));break;
  }
}
  while(1){
    //Check if the camera module type is OV5642
    myCAM.wrSensorReg16_8(0xff, 0x01);

    myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid); //// why is this saying not declared *******************

    myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);
    if((vid != 0x56) || (pid != 0x42)){
      Serial.println(F("ACK CMD Can't find OV5642 module! END"));
      delay(1000);continue;
    }
    else{
      Serial.println(F("ACK CMD OV5642 detected. END"));break;
    } 

I do not have the libraries, and don't want to find and install them, so cannot verify the code to see the exact text of the error. Please post the entire error message. Paraphrasing the error leaves out important information. If you are using the IDE there is a "copy error messages" button. Copy the error and paste into a post in a code block (code tags).

1 Like

The code is incomplete. Please post the whole code. We cannot verify incomplete code either. You are missing the loop() function.

Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in a code block.

It may help if you post the memorysaver.h file as well.

@larenzia93 don't keep making new threads on your problem with combining two sketches!

Instead just respond in one thread, then we all stay up to speed.

a7

this would be so much easier if you posted the error messages

no it different

no its different

1 Like

stop being so thirsty to flag people
this is a different code for a camera
ardu cam 5

the other codes were combing servo and ultrasonic

error message`Arduino: 1.8.16 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:28:1: warning: narrowing conversion of '240' from 'int' to 'char' inside { } [-Wnarrowing]

};

^

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:28:1: warning: narrowing conversion of '196' from 'int' to 'char' inside { } [-Wnarrowing]

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:28:1: warning: narrowing conversion of '196' from 'int' to 'char' inside { } [-Wnarrowing]

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:28:1: warning: narrowing conversion of '248' from 'int' to 'char' inside { } [-Wnarrowing]

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:28:1: warning: narrowing conversion of '224' from 'int' to 'char' inside { } [-Wnarrowing]

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino: In function 'void setup()':

ArduCAM_Mini_5MP_OV5642_Plus_Functions:72:27: error: 'OV5642_CHIPID_HIGH' was not declared in this scope

 myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid); //// why is this saying not declared *******************

                       ^~~~~~~~~~~~~~~~~~

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:72:27: note: suggested alternative: 'OV2640_CHIPID_HIGH'

 myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid); //// why is this saying not declared *******************

                       ^~~~~~~~~~~~~~~~~~

                       OV2640_CHIPID_HIGH

ArduCAM_Mini_5MP_OV5642_Plus_Functions:73:27: error: 'OV5642_CHIPID_LOW' was not declared in this scope

 myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);

                       ^~~~~~~~~~~~~~~~~

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:73:27: note: suggested alternative: 'OV2640_CHIPID_LOW'

 myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);

                       ^~~~~~~~~~~~~~~~~

                       OV2640_CHIPID_LOW

ArduCAM_Mini_5MP_OV5642_Plus_Functions:86:33: error: 'VSYNC_LEVEL_MASK' was not declared in this scope

myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK); //VSYNC is active HIGH

                             ^~~~~~~~~~~~~~~~

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:86:33: note: suggested alternative: 'VSYNC_MASK'

myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK); //VSYNC is active HIGH

                             ^~~~~~~~~~~~~~~~

                             VSYNC_MASK

ArduCAM_Mini_5MP_OV5642_Plus_Functions:90:17: error: 'ARDUCHIP_FRAMES' was not declared in this scope

myCAM.write_reg(ARDUCHIP_FRAMES,0x00);

             ^~~~~~~~~~~~~~~

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:90:17: note: suggested alternative: 'ARDUCHIP_REV'

myCAM.write_reg(ARDUCHIP_FRAMES,0x00);

             ^~~~~~~~~~~~~~~

             ARDUCHIP_REV

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino: In function 'void loop()':

ArduCAM_Mini_5MP_OV5642_Plus_Functions:166:35: error: 'VSYNC_LEVEL_MASK' was not declared in this scope

 myCAM.clear_bit(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);

                               ^~~~~~~~~~~~~~~~

C:\Users\Jlo\AppData\Local\Temp\arduino_modified_sketch_263237\ArduCAM_Mini_5MP_OV5642_Plus_Functions.ino:166:35: note: suggested alternative: 'VSYNC_MASK'

 myCAM.clear_bit(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);

                               ^~~~~~~~~~~~~~~~

                               VSYNC_MASK

Multiple libraries were found for "ArduCAM.h"

Used: C:\Users\Jlo\Documents\Arduino\libraries\ArduCAM

Not used: C:\Program Files (x86)\Arduino\libraries\ArduCAM

Not used: C:\Users\Jlo\Documents\Arduino\libraries\Arducam_mini

exit status 1

'OV5642_CHIPID_HIGH' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
`

where is this defined?

1 Like

To atone for my thirsty thirst, I googled looking for your missing symbol and found

The issue you specifically raised ( 'OV5642_CHIPID_HIGH' was not declared in this scope) may be resolved by modifying "memory_saver.h" to uncomment the preproccessor directive corresponding to your device. I'm assuming you are using the OV5642, so you should uncomment "#define OV5642_CAM" and comment the other #define's.

which may mean you do need to include memory_saver.h - last I saw it was commented out.


This

may also be an issue. The IDE had to select from multiple libraries. Be sure it is using the one you think, the one that was used by whoever wrote the beginning version of your sketch.

HTH

a7

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