This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

camera_application single image capture



I am working with the MT9D111 camera and the camera_application demo.  When I hit the "start" button, I want to capture a single image and then stop.  (not keep uploading images until I hit stop).  I tried to accomplish this by setting g_CaptureImage to 0 as seen below, but it doesn't work?  This code starts on line 691 of camera_app.c

 

   do
    {
        while(g_CaptureImage)
        {
            CaptureImage();

            if(lRetVal < 0)
            {
                LOOP_FOREVER();
            }
            g_CaptureImage = 0; //This as added from original demo code.
        }
    }while(1);

But the image still keeps updating?  Is something else setting g_CaptureImage to 1?  why does it keep capturing images?

  • Hi Jerome,

    Thats should have worked. Are you using the debugger or flashing the bin file to execute?

    Is the debugger giving any clue - do you see the variable value changing after it is reset? The only other source of the variable being set is if the start command is issued again.

    Best regards,

    Naveen

  • @Naveen,

    Thanks for the help.  So here is what happened.  I come from an atmel background and in the atmel world (at least on the chips I developed on) the debug code gets flashed to the chip.  I was having trouble with the camera in debug mode so I cycled power to reset the camera.  (and I thought the debugger code was still running after power-up)

    After reading your post I tried flashing it with the .bin file and it worked as expected.  So I guess the debug code only lives in RAM.  Anyway thanks for the help.

    So I can't really say post is verified answer, but your clue sure helped me figure it out a lot quicker.

    Jerome