How to Program v5 Led Lights

Okay, but with all do respect Mr. Sazrocks, I have previously coded and it seems like I have a good understanding and basis of C++.

I do not mean to offend, but the way that you wrote that “code” makes it very clear that you do not

But I was just copying the code from early suggestions I can show you my actual code which is not complicated, but at the same time does not show I am a begineer with C++

v5code-project-Practice3.zip (21.0 KB)

You might do something like this:

led <name> = led(Brain.ThreeWirePort.<port_letter>);

task(main){
    <name>.on();
}

Oh okay, thank you so much I really appreciate it.

Mr. TaranMayer your suggestion did not work. Do you want me to show you the errors that occur when I types in your code

Sure…

@bossasawsome272 go ahead and post it

Nevermind I figured it out. What I did was use your code and then created a variable. I mean that is probably one way to do it. I am going to try and compile the code and see if it works

If you don’t mind me asking, could you post the code you had anyways?

Yeah sure give me one second. By the way the code worked

I made some edits and you were right most of your code was correct
image

Uh, I just looked through the project you sent and… you definitely need to go learn actual c++. That was painful to read.

Also there are a crapton of weird things that make no sense. Why are you setting a motor to spin at 300% power? That doesn’t work.

Actually it does I just tested it. I just wanted to see how fast v5 motors can go. I am not keeping the value I was just curious.

I’m more concerned about other things in this code than that…

He defined autonomous() inside the main loop

Generally speaking the fastest anything can go is 100% of its max speed.

Respectfully, your code shows the opposite of what you intended. I strongly suggest that you go though some basic C++ tutorials before continuing to program your robot. It will greatly benefit you to properly understand C++ concepts when you go to debug your code and made it do what you indended.

2 Likes

Guys most of this is not my code you guys now that

Yeah we noticed that.

Me and my friend was working on something I just needed to code the base and led lights