Coding Help With V5?

So Our team just got enough money for a V5 competition kit, and none of us really have a guide on the coding system. Our programmers our completely new to programming, minus some of the Cortex stuff that we’ve known for a couple of months. If anyone can link me to a coding guide for V5 or something, that’d be really helpful!

Last year I wrote a project for Hour of Code that did a bit of introduction to Robot Mesh Studio’s Blockly for V5. If you’re using Chrome, you can work through it all online here.

1 Like

Your tag says Vex IQ, so it’s going to make people confused, you can change it to EDR. Vexcode is what most people get started with nowdays, so you would want to download that

There are lots of prebuilt codes out there. I recommend looking at some basic control codes and putting them into a competition template to start. After you have made a working code experiment with it some and some new commands. After a while you should get the hang of it and be fine.

I’ve been looking for some prebuilt code to help me learn but I can’t find any. Do you have any links?

What coding studio do you use?

Vexcode. Thanks.
20 characters

VEXcode has built in examples - go under File menu and open example.

Look at articles in help.vex.com

Yeah, but tbh they don’t cover very much, only simple stuff. I was wondering if anyone made they’re complex driving/auton code available. I was especially looking for a simple program to select autons using the screen.

Here is what our club did last season - you can have it work in VEXcode - ports easily.

Thanks, I’ll take a look.

OurCode.zip (11.4 KB)
Heres our current code. I am hoping to implement sensors and that button select thing for autonomous.

Thanks, I’ll take a look at it tomorrow. Let me know if you get that button thing working, I’ll be working on it to.

I found a solution that doesn’t break the code maybe, so I’ll post it in a little bit.

37%20PM
So first I set up a variable
30%20PM
Second I put the command that activates the variable in my driver control but outside the while loop
24%20PM
Here are the speeds for the arm
16%20PM
This makes it so that when button x is pressed and y=50 it activates that part of the code
05%20PM
This is what happens then button x is not pressed and y does not equal 50

Hopefully this is a good solution that works, but I will need to wait until tomorrow to test it out with our robot.
Heres the whole shabang if anyone wants to take a look and test it for themselves.
OurCode.zip (12.0 KB)

Well, it won’t work for the reasons I explained a couple of posts up, y is a local variable to the function “function” (which is a bad choice of name for obvious reasons). The green squiggle under the y is a warning, it’s probably telling you that you have variable that’s never used.

1 Like

It’s never used IF button x is never pressed, so I’m not entirely convinced it won’t work. My guess is that normally y won’t equal anything, so it will activate the else. But when button x is pressed and y=50 it will switch to the other code and be a bit faster.

you have a global as well.

int y;

but function has a local variable as well, this would work (remove the variable type and assign to the global)

void function(){
     y=50;
  } 
1 Like

Im not sure what you mean by removing the variable type and assigning to global

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.