How do I send data to the camera over USB?

Hello, I have my OV7725 connected to a Raspberry Pi via USB, happily running a script stored in its internal memory as main.py. I can get the script’s print outputs on the RPi by opening a serial port to /dev/ttyACM0. However, how do I do the opposite, i.e., if the RPi sends something over this serial connection, how does the camera read it?

Have you tried this ?
http://docs.openmv.io/library/pyb.USB_VCP.html?highlight=readline#usb_vcp.readline

Example:

import time, pyb
led = pyb.LED(3)
usb = pyb.USB_VCP()

while (True):
    line = usb.readline()
    if (line):
        print(line)
        led.on()
        time.sleep(150)
        led.off()
        time.sleep(150)

Note you can’t use this while the IDE is connected, and you need to set the baudrate to anything other than (921600 and 12000000). Since you’re on Linux you can use stty

stty -F /dev/ttyACM0 115200

.

Aha, no I had not. Tried it and it works, thanks a lot.