Fast communication

what is the fastest way to send a 2 digit integral from openmv to teensy. If it is spi is there a way to make the example code (rpc library) faster?

The RPC library is already at the max speed. However, it’s half duplex communication. So, the master tells the camera to do something, it does it, and then returns the result.

SPI is half duplex so you always have that overhead (SPI can do full duplex… but, not with two masters that are async).

If you want full-duplex streaming then you want to use the RPC library in stream mode with a UART. You can setup the connection using a normal RPC call to establish the connection at half duplex and then switch to stream mode so that the camera and freely send results back to the Teensy without needing to wait for a command. This will give you the best speed.

Here’s how you do stream mode on the camera: openmv/ at master · openmv/openmv · GitHub

You want to change the interface to the UART.

Here’s how that interfaces to the PC: openmv/ at master · openmv/openmv · GitHub

Finally, here’s the Arduino in stream mode… openmv-arduino-rpc/arduino_to_arduino_streaming_comms_as_the_controller_device.ino at master · openmv/openmv-arduino-rpc · GitHub

Note that none of these examples do what you want. You’ll need to modify the code quite a bit. I apologize if there’s no enough examples for RPC mode. It’s a pretty flexible library and there are all sorts of ways to use it.

I didn’t put the stream mode examples everywhere since they are hard on the Arduino Uno which doesn’t have a lot of RAM to handle fast Comms.

Thankyou so much for your fast response! I am part of a robotics team (Team Roboticus) and we are currently competing in the european championships, this will help us immensly.