Hello. I'm in a team for my school and I'm having issues with my code

My code worked fine before Christmas break hit. After that, I modified it a little bit, and now it won’t work properly. I have 2 motors in a group that are named launchers. On my old code, they worked but the rest doesn’t (except for drivetrain, as it works very well). My newly rewritten code (basic) has only one launcher that works and nothing else works (except drivetrain again). I’m using block code, and the extension on my school chromebook. I’ve also verified my connections, motors, and everything else.

Welcome to the forums!
Can you please send a picture of your code so we can help better?

5 Likes

First off, I highly recommend switching to C++. It is easier than it looks, and only hard in certain situations, also you can look up videos and drag code in from the sides. It is much more versatile and easy to work with. Plus, it specifies errors in the code, so even if you don’t want to change you code, you can make a copy of it and change the copy to C++, press “Build”, and see errors. If there are no errors, the problem isn’t the code, it is either the motor port, motor cord, or motor itself.
Also, maybe specify what exactly you “modified”

Also, the extension is V5, for easier context.

2 Likes

Yes. Here is 1.

Now 2.

And, finally, 3.

1 Like

1 and 2 are the old code, but 2 parts. Forgot to mention that!

1 Like

Hmm. First off, what reason did you have to change it? Always remember, if any ideas given by replies don’t work, you could always go back as you have the images.
However, while I don’t have much blocks experience, this does seem contradicting. “If 0, set it to 1. Otherwise (If 1), set to 0” seems to either be some sort of odd infinite loop or just a straight up paradox. Also, it being “bound” to two buttons seems odd. Is this all on purpose? Also, I still recommend switching to C++. It isn’t hard to learn, and your coach and people on the forum could help you. It would be much more simple to run motors in such a strange way as well, as I have never seen blocks code made quite like this.
TL;DR: Very odd code. Maybe try going back? Also try C++.

1 Like

By the way, wouldn’t this be easier? Or am I missing something?

1 Like

I figured it out. All I needed was to move the contents inside 2 seperate forever blocks into one forever block. Easily works now

1 Like

Well, @VenomousSteam81 , out of curiousity, would this work for your purpose? It seems simpler but I might be misunderstanding something.

1 Like

Think just for clarity, his is better as it shows on button hit. I do think that your code will work, but his looks prettier(?) I guess. Not really experienced with block code though

1 Like