Multiple SPI with RPC Library

How can I use two SPI (MOSI(0), MOSI(1) and MISO(0), MISO(1) with the RPC Library?
Thank You.

The library just uses your SPI bus and then you defined the CS pin to use when you call it. So, if you have more than 1 CS pin then you can use it with more than 1 device.

Thank you Kwagyeman for your quick reply.
I understand your explanation, BUT what if I wish to use two separate SPIs on my Teensy 3.2?
Is there a ways to declare different SPIs ( with different cs) in the RPC Library?

Thank you.

Ronin45

No, just modify the code if you need to do that. I just statically call the SPI object.

Thank you for responding Kwagyeman,

On another note:
Can I use the RPC Library to IR track an object and send the data back to my Teensy?

It seems “ color_thresholds[6] “ setting don’t work for the OpenMV IR LEDs.

Any example available.

Thank you

Alex

You just want to track basically white color blobs for IR LEDs in grayscale. IR LEDs looks like the sun to the camera.

Dear Kwagyeman,
Thank you for responding so quickly.
I have been teaching myself python and electronic so please excuse my lack of understanding.

I’m using the RPC “ Remote Control - As The Remote Device “ and selecting “ def color_detection(data): “

On the Teensy side I have:

void exe_color_detection()
{
int8_t color_thresholds[6] = {30, 100, 15, 127, 15, 127}; // generic_red_thresholds
// int8_t color_thresholds[6] = {30, 100, -64, -8, -32, 32}; // generic_green_thresholds
// int8_t color_thresholds[6] = {0, 30, 0, 64, -128, 0}; // generic_blue_thresholds
struct { uint16_t cx, cy; } color_detection_result;
if (interface.call(F(“color_detection”), color_thresholds, sizeof(color_thresholds), &color_detection_result, sizeof(color_detection_result))) {
Serial.print(F(“Largest Color Detected [cx=”));
Serial.print(color_detection_result.cx);
Serial.print(F(“, cy=”));
Serial.print(color_detection_result.cy);
Serial.println(F(“]”));
}
}

Question: Do I change the values in one of the included “ color_thresholds[6] “ ?

I’m not sure what goes in the Teensy side.

I have managed to turn on the IR LED and can easily track the object while my OpenMV is connected to my Mac, but can’t figure out how to send IR data to Teensy.

Thank you again for your time and effort.

Sincerely,

Alex

Yeah, you just want thresholds of {200, 255, 200, 255, 200, 255}.

Then the results will be returned.