Using the USB port to communicate with Raspberry Pi

On a few other threads people mentioned using the USB port to communicate with a Raspberry Pi. I think this could be really useful for data collection, getting live values, etc. However, I couldn’t find an example program for how to do this in VEXcode. If anyone has successfully done this in VEXcode, I’d appreciate if you shared!

1 Like

The V5 implements a composite USB device that has two serial ports. The second serial port is for use by user code, use standard C or C++ stdio functions like printf or std::cout.

If your goal is data collection, you can have the USB port give information back to a computer’s terminal, you can save data to an SD card, or you could display it on the brain.

So the std::cout stream sends values over USB as well as displays them to the screen? (I don’t have much experience with serial communication or c++, but I’m learning!)