New course! Every coder should learn Generative AI!
Try a free lesson+ 1
you can connect your arduino through the usb port on the rpi. The program on the rpi must access the serial port and there must be a communication proyocol between the MCU and your program.
If you don't want to do that proticol yourself, have a look at the firmata library