Using Both Arduino and Raspberry Pi

We’re planning on using both a Raspberry Pi(For vision co-processing) and an Arduino(To be able to have multiple I2C sensors). Would this be competition legal? And what would be the best way to connect the Arduino?

No reason I could see that this would be illegal unless for some reason one of them violated a stray rule (e.g. you were powering it from an illegal source such as a 9V battery).

What do you mean by “connect,” power or data? For data, sounds like you’ve already selected I2C. If you mean to run I2C sensors connected to the arduino and then to connect that to the RIO, you should consider USB, SPI, and serial as options. If you select USB, power’s done. If not, many arduinos can be powered directly off of the robot power, though I prefer to use an external 5V regulator, either a COTS one (an auto USB charger works well) or just using a 5V regulator chip.

We’re planning on using USB(Would using a cable that connected the USB-A port on the Arduino to one of the USB ports on the RoboRIO work?) for both data and power, so what would be the best way too program this?(c++)

You’d most likely program the arduino with the arduino IDE, which is C++. This doesn’t necessarily mean that the RIO side code has to be C++. If you haven’t already sourced the arduino, I recommend using a Leonardo, micro, pro micro, or other ATmega32u4 based arduino because the USB is done in the main CPU, and the serial connection over USB seems more consistent than with unos, at least. You also don’t need a separate programmer cable for them.

I was more wondering how I would get input from the Arduino onto the RoboRIO, As I already have code on my Arduino that works. Could you provide some example c++ code for the RoboRIO to interface with the Arduino? I’m using VSCode if that helps. Thanks!