Setting up robot config in VEX Code Preview 3

How do you config sensors in VEX Code Preview for the V5? Last season, we had migrated from VCS to VEX Code Preview so the robot-config.h file was set up automatically. Now we are trying to config a pot and looking at last years program, typed in < vex::pot ArmPot(Brain, ThreeWirePort.A);> but on doing so receive an error message saying:
error: use of undeclared identifier ‘ThreeWirePort’ and when I right clicked on it and went to Go to Definition, it said no definition found. What is the correct syntax for configuring sensors under VEX Code Preview? Thank you. :slight_smile:


You need to say that the three wire port is a part of the Brain by using a period between the Brain and ThreeWirePort. Use code like I screenshotted.


Also, you can see a way to get the normal coding syntax highlighting in Vex Forum posts in this post (I put the link below). I have found this to be really helpful, and it helps other people with reading and understanding your code. It is usually preferable for most people than just reading plain text. But it is mostly ornamental, not necessary.

1 Like

Thanks for the fast response. We took that “.” for a “,”. :slight_smile: