Hey, I was researching into V5 and I noticed that it is now being programmed through “Vex C++”. How would you write lines of code through this language as compared to ROBOT C? For example, in ROBOT C, I would write
motor[Claw] = 127;
How would I write this in Vex C++? Additionally, what are the main differences between ROBOT C and Vex C++? Thanks in advance.
I don’t know the answers to most of your questions, but I do know that C++ is based on C, so that whatever lines you desire to write will be relatively similar in both languages.
I don’t know the specifics for the function calls and objects, but you’ll see commands that look something like this:
in place of
What I recommend is looking up a quick tutorial in C++. Once you understand the idea behind object-oriented programming, with the similarities between C and C++, you’ll pick up the rest quickly. The trick is really just understanding how objects are implemented and used, and you’ll get that from all sorts of online tutorials.
Thanks! Do you know how timers work, as in ROBOTC’s
The standard C command for this is
void delay(unsigned int);
So you use it like this to delay 500 ms:
This is essentially the same as wait1Msec(500); that you would use in RobotC. What I prefer is it is consistent throughout C. So, for example, if you program Arduinos using C/C++, you would use the same command.
java script is were its at noobs
The problem of scripting languages isn’t as much the speed (there are crazy optimizing compiler techniques that blur the speed difference, at the cost of startup time and metadata footprint), as the lack of reasonable compile/build/upload-time validation.
You really don’t want to learn that you typed “shooot(50)” instead of “shoot(50)” in the middle of the match when you engage that part of the code for the first time…