ArduCAM / ArduCAM_USB_Camera_Shield

This is the repository for ArduCAM USB Camera Shield
126 stars 69 forks source link

setFocus: Attempt to call a nil value (global 'SendVR') #171

Open greezybacon opened 2 years ago

greezybacon commented 2 years ago

With the Arducam USB 3.0 plus shield, UC-593, Rev C; and an IMX230 MIPI camera connected, I am able to build the Streaming demo (on ARM64 platform using the source in the Nvidia_Jetson folder).

Extending the code to work the focus motor, when I call the "setFocus" control with ArduCam_setCtrl(cameraHandle, "setFocus", focus);, I get no effect and this output on the console:

=[string "function setFocus(val)..."]:7: attempt to call a nil value (global 'SendVR')

Is there something I should setup prior to calling the setFocus control?

greezybacon commented 2 years ago

I was able to control the focus motor with this code (interpreted from the setFocus Lua code in the config file):

uint16_t val = (focus << 4) & 0x3ff0;
uint16_t high = (val >> 8) & 0x3f;
uint8_t data[] = { val & 0xf0 };
ArduCam_setboardConfig(cameraHandle, 0xD7, 0x1800, high << 8, 1, data);