ArduCAM / RaspberryPi

This is Arducam camera demos used on Raspberry Pi paltform
BSD 3-Clause "New" or "Revised" License
163 stars 97 forks source link

Is initializing camera 3 in Multi_Camera_Adapter_V2.1_С++.cpp correct? #28

Open A-lex979 opened 4 years ago

A-lex979 commented 4 years ago

Hello! I'am using multicamera adapter module V2.1 (B0120). It works great with python code. But when I started use c++ code I found this:

 } else if (cam == 2) {
        #ifdef ENABLE_CAMERA_2
        system("i2cset -y 1 0x70 0x00 0x05");
        digitalWrite(7, HIGH);
        digitalWrite(0, LOW);
        digitalWrite(1, HIGH);
        #else
        return -2;
        #endif
    } else if (cam == 3) {
        #ifdef ENABLE_CAMERA_3
        system("i2cset -y 1 0x70 0x00 0x05");
        digitalWrite(7, HIGH);
        digitalWrite(0, LOW);
        digitalWrite(1, HIGH);
        #else
        return -3;

Initializing camera 3 is same as camera 2 I think it is error because in python code initializing camera 3 looks like:

        i2c = "i2cset -y 1 0x70 0x00 0x06"
        os.system(i2c)
        gp.output(7, False)
        gp.output(11, True)
        gp.output(12, False)

I corrected code

    } else if (cam == 3) {
        #ifdef ENABLE_CAMERA_3
        system("i2cset -y 1 0x70 0x00 0x06");
        digitalWrite(7, LOW);
        digitalWrite(0, HIGH);
        digitalWrite(1, LOW);
        #else
        return -3;

And Your c++ code example now works great P.S. Sorry for bad English

ArduCAM commented 4 years ago

Would you please post your question on our forum at : https://www.arducam.com/forums/