I use Openmv rt1062 and want to send print data to the Arduino due. Unfortunately I have blown the camera uart.
I found this:
Um, yes, the OpenMV Cam appears as a serial port and you can use the print method to send data out of it.
So, just develop a script in OpenMV IDE that prints the results you want to print… Then once done… Close OpenMV IDE and have an application open the serial portof the camera and read the print statements.
How can Arduino due open the serial port of the camera?
Or is there some other way to send the data to the Arduino?
Uh, when you say you’ve blown the UART, you mean the TX pin, P4 of the RT1062, is broken?
The UART mentioned above is the USB Virtual COM port. You’d need a system that can act as a USB host to send data via this method. So, pretty much only something running an operating system.
…
An alternative is to use SPI or I2C to talk to the Arduino. There are software I2C/SPI drivers for the RT1062 that let you use any I/O pin.
The gool is to send labels = [“NOT”, “ROUND”, “STOP”, “TURN”] and round(max_score, 2) to the arduino.
Sending above as a string to the Arduino due is what I want.
Do you have suggestion?
I have found this: Arduino Due Code (USB Host Driver)
The Due must explicitly establish a connection to a generic USB Serial device (CDC class) to intercept the OpenMV print() outputs.
cpp
``` #include <USBHost.h>
// Initialize the USB Host and CDC/ACM serial driver
USBHost usb;
CDCAsync cdc(&usb);
void setup() {
// Start the Programming Port Serial to view output on your PC
Serial.begin(115200);
while (!Serial);
Serial.println(“Arduino Due USB Host Initializing…”);
// Initialize the USB Host engine
if (usb.Init() == -1) {
Serial.println(“USB Host failed to initialize.”);
}
delay(200);
}
void loop() {
// Poll the USB bus for new events
usb.Task();
// Check if the OpenMV Cam is connected and active over USB
if (cdc.isReady()) {
uint8_t buf[64];
uint16_t rcvd = 64;
// Read raw data coming from OpenMV’s VCP
if (cdc.RcvData(&rcvd, buf) == 0 && rcvd > 0) {
for (uint16_t i = 0; i < rcvd; i++) {
Serial.print((char)buf[i]); // Forward the print() to your PC
}
}
}
}
```