Memory Permission Error V5 Vex Code Pro

Oh ok, Yah i just now realized there is only 21 external ports. That clears things up now. I will fix that right now but I won’t sadly be able to test it sense my next practice is next Monday I think. My team is school lead.
Edit: I think I should be fine. That is one main thing I have added that would have changed that. Everything else on there I have actually know how to use and do for a while. But if you could look at my code and give me tips and tricks if you are free would be great. I am always trying to improve and it is now a bit harder sense the senior that taught me for like years is now gone. And I didn’t even get to learn half of what he knew

There are certainly improvements you could make. I would start by adding some functions to handle all the duplicated lines of code for the drivetrain etc. All the lines like this

LeftMotor.rotateFor(-900, vex::rotationUnits::raw, 70, vex::velocityUnits::pct,false);//Angles towards goal
RightMotor.rotateFor(900, vex::rotationUnits::raw, 70, vex::velocityUnits::pct,false);
BackLeftMotor.rotateFor(-900, vex::rotationUnits::raw, 70, vex::velocityUnits::pct,false);
BackRightMotor.rotateFor(900, vex::rotationUnits::raw, 70, vex::velocityUnits::pct,true)

could easily be turned into a function with just a couple of parameters. I would also get away from using raw rotationUnits, it would be better to use something more understandable like degrees. Remember you are writing code to be read, the easier you make it for someone else to read the code the more chance it has of being good reliable code.

2 Likes

@jpearman I was able to test it today and it still gave me the same error. Yes I made sure I put the correction in there. I am not sure what is wrong with it. Could it possibly be something else.

And I forgot to mention when I download it, it says there is a download error.

er, so the program is probably not downloading. Any other programs such as firmware update utility open ?
otherwise, zip up the project and send it to me.

3 Likes

What do you mean was anything else open

Do you mean was there any firm ware updates. And no I am pretty sure there wasnt

I mean if you have a download error there’s some problem, you probably keep executing the old code, the program really does have some sort of error or the download was corrupted by something else trying to communicate with the V5 brain. That can happen if you have more than one program trying to communicate with the brain, for example, both VEXcode blocks and VEXcode Pro open.

4 Likes

Yah I don’t have anything else that could communicate with the brain so would you like me to send you a zip of my code. And how do I do that

either export the project and send me the resultant zip file or just zip up the project folder using some other utility. Then attach to this topic or send to me as DM.

3 Likes

v5code-project-MyProject2.zip (36.7 KB)

yea, you didn’t apply all the fixes. These lines

vex::limit LimitSwitchA = vex::limit(Brain.ThreeWirePort.A);
vex::limit LimitSwitchB = vex::limit(Brain.ThreeWirePort.B);

need to be changed to

vex::limit LimitSwitchA = vex::limit(ThreeWirePort.A);
vex::limit LimitSwitchB = vex::limit(ThreeWirePort.B);

see the previous explanations

8 Likes

once I did that it builds and runs
test1

but your download error is something else, perhaps reboot PC and only open VEXcode.

5 Likes

well the thing is we tried it with two different laptops

Did you reboot and reopen on both? I’ve found that this works 99% of the time.

3 Likes

no we didn’t
20 chara

Was this direct to the brain or wireless ?

3 Likes

this was direct strait to the brain

:man_shrugging:

7 Likes

Hey we got it to work today. Thanks for the help and tips.

1 Like