0

以下是我激活相机时的代码:

Serial.println("File Created");
}
//camera operation
Serial.println("Sending Reset command");
SendResetCmd();
Serial.println("Sending Take Photo Command in 3 seconds");
delay(3000);
SendTakePhotoCmd();
// Get Image Size **************************************
Serial.println("Sending Read Image Size command");
delay(80);
GetImageSize();
delay(80);
Serial.print("Image Size: ");


void dumpCameraInput(boolean verbose)
{
    // Use this before issuing a command to be sure the buffer is empty.
    byte incomingbyte;
    if (verbose == true)
        Serial.print("clear camera buffer, dumping...");
    while(mySerial.available() > 0)
    {
        incomingbyte=mySerial.read();
        if (verbose == true)
            Serial.write(incomingbyte);
    }
    if (verbose == true)
        Serial.println("... END DUMPING");
}

void SendResetCmd()
{
    dumpCameraInput(true); //clear camera buffer
    mySerial.write(0x56);
    mySerial.write((byte)0);
    mySerial.write(0x26);
    mySerial.write((byte)0);
}

void SendTakePhotoCmd()
{
    dumpCameraInput(true); //clear camera buffer
    mySerial.write(0x56);
    mySerial.write((byte)0);
    mySerial.write(0x36);
    mySerial.write(0x01);
    mySerial.write((byte)0);
}

结果如下:

"File Created
Sending Reset command
clear camera buffer, dumping...v1... END DUMPING
Sending Take Photo Command in 3 seconds
clear camera buffer, dumping...v&VC0703 1.00
Ctrl infr exist
User-defined sensor
625
In... END DUMPING"

我不需要“v1”和“dumping...”和“...END DUMPING”之间的单词。

我的代码出了什么问题?问题来自 voiddumpCameraInput(boolean verbose)函数吗?

4

0 回答 0