Device Handler

Back to Tutorials

2. Smooth Viewer 4. Events 1 2  3  4  5  6  7  8  9  10  11  12  13  14  15  16



In this tutorial we will go through different interactions with the sensor. It is really easy to start it or stop it, etc.. and this is how to do it. The only requirement is to create the ViiM engine (if you haven't read the first tutorial, we really advise you to do it). Afterwards we set events to be triggered at certain key presses:

This snippet of code is self-explanatory: press s to start the sensor; S to stop it; p to pause it; r to resume it and R to restar it with ViiM_QVGA resolution.

Apart from these obvious directions, some other "guide notes": --> Once the program starts, the camera automatically starts and if you press "s", nothing will happen; all other keys will work. --> If you press "S" (Stop), the image goes black. The camera will start with the same settings if you press "s" (start), or with the ViiM_QVGA (320x240@60fps) setting on if you press "R" (Restart) ("R" can also be pressed during the normal operation of the camera). --> If the camera is working and you press "p" (pause), the image will freeze. The "r" key (resume) will resume it.

Oh and don't forget lines 12 and 13! These two methods return the width and height of the raw images respectively. We added that piece of code so that when we press R and change the resolution, we adapt our application's images sizes to the ones coming from ViiM.

Could it get any easier? :) Check the code in the apps folder, the ViiM_OF_Samples and choose your OS.

2. Smooth Viewer 4. Events 1 2  3  4  5  6  7  8  9  10  11  12  13  14  15  16

Back to Tutorials