I want to use my raspi connect with V5 brain for the VexU , but I cant find how can i use the serial of the v5 brain, what can i do? If it use the smartport of the brain ,how can i connect it with my raspi,or it can use the usb?
Looking forward your help!Thank you!
I was also wondering how to do this.
Connect V5 USB to the RasPi, use stdio on the V5 brain and open the serial port on the RasPi side. The V5 will show as two serial ports on the RasPi, usually âttyACM0â etc. you may need some udev rules. Then you need to define messages to pass between the two, if you are in VexU this should all be achievable.
Do you have some sample code?
You could take a look at the code released for the VexAI competition this year. That uses a Jetson Nano rather than a RasPi, but there is an example for the V5 side that you could start with.
https://www.vexforum.com/t/tutorial-linking-vex-brain-v5-with-arduino-or-raspberry-pi-esp32-etc/115687?u=lijh
I read this before,it told me a way to connect the raspi with the V5 brain by the smartport,and it communicated by pretending to be a Raspberry Pi as a motor,but I not sure can it realtimeâcommunicate.
I want to communicaty by usb,but I cant find anything about the usb serial in V5 code pro or VScode.I have not used PROS,so I dont know is it in PROS.
Actually âpretending as a motorâ isnât necessary, you can choose anything you like because it just lets the vex brain know that there is a device on that port.
As for âreal-time communicationâ, Unlike ttl, rs485 uses differential signals, which determines that it is half-duplex, which means that it seems that VEXâs own official stuff cannot truly âreal-time two-way communicationâ (it can only be achieved by rapid transceiver conversion maybe)
Anyway, by âreal-time communicationâ it should be possible (you probably mean being able to send and receive messages over the serial port in real-time), as long as you follow my tutorial steps
Indeed, creating a motor on the port is completely unnecessary.
Instead of
//robot-config.cpp
motor Arduino = motor(PORT20, ratio18_1, false);
//main.cpp
#define BAUDRATE 115200
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
vexGenericSerialEnable(Arduino.index(), 0);
vexGenericSerialBaudrate(Arduino.index(), BAUDRATE);
}
Just do
//robot-config.cpp
//main.cpp
#define BAUDRATE 115200
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
vexGenericSerialEnable(PORT20, 0);
vexGenericSerialBaudrate(PORT20, BAUDRATE);
}
You can also use stdio calls on the smartports which will hide the details of the C vexGeneric⌠APIs.
see example here.
Yes, you are right.
Thank you for the correction.![]()
Is it using for usb?