This example activates a compatible camera connected to the MIPI Camera Connector and routes the image in real time to the microHDMI connector. It is a very basic example that shows how simple may be the usage of the advanced features of the Arduino MKR Vidor 4000 board.
Include the VidorCamera library, which is part of VidorGraphics.#include "VidorGraphics.h"
#include "VidorCamera.h"
You have a number of functions available to create and manage the camera stream.
VidorCamera()
- initilize object
int begin()
- initilize cam and starts streaming; return 0 if failed
int end()
- stops streaming and shutdown camera
int enableStream()
- explicitely enable stream
int disableStream()
- exclicitely disable stream
int modelDetect(void)
- detect the attached camera model
In our example we create the object vcam
and then we simply enable I2C communication and initialize the camera with the vcam.begin()
function. Please note that this function returns a value and we use it to print out an error message if initialization fails.
When the video stream is active and it is routed to the HDMI port, you can stop the video opening the serial monitor and typing STOP. This activates the vcam.end();
function.
The complete sketch is below and you find it in the examples from Libraries, under VidorGraphics :
For more details on the Arduino MKR Vidor 4000, see the product page.
Last revision 2018/07/22 by SM