Basic code for bot

I need help with making a basic code for a bot that has two motors (for now) any help will be appreciated

Um… like a two motor drive?

No, this isn’t iq it’s edr

Yes, I believe so that is is 2 motor drive

Text, the reason why I’m posting is because I can’t find any tutorials or templates for a basic code for a bot

There are some in there but here is this example
For a tank drive
Motorname.spin(directiontype::fwd, Controller1.axis1.value, velocity units::pct)
With buttons
If(controller1.buttonx.pressing()) {
Motorname.spin(directiontype::fwd, put your speed here, velocity units::pct)
}
Else if {
Motorname.spin(directiontype::rev, put your speed here, velocity units::pct)
}
Else {
Motorname.brake(braketype::(choose between Hold stop and coast))
}

Not exactly what I needed but thanks!

Are you looking for arcade drive?

As in…? I don’t know what most of this means… we just got v5 and all of this v5 text coding stuff is new to me…

Okay, I’ll explain the two main ways of controlling the drive.
Arcade drive
Uses one joystick to control all movement
Pros
Only needs one finger to operate
Cons
Not as crisp movement

Tank
Uses one joystick per side
Pros
Crisp movement
Cons
Uses two fingers

There’s other stuff, but those are the basic ones. Which would your driver prefer?

1 Like

Tank. I just didn’t know that it was called that…

Yes, I’ve set up the motors and controller.

leftwheel.spin(directiontype::fwd, Controller1.axis4.value, velocity units::pct)
rightwheel.spin(directiontype::fwd, Controller1.axis2.value, velocity units::pct)

Pop that in and see if it works. Make sure to put it in the user control and in the while loop.

axis3 not axis4
20char

1 Like

@Almondtree, I’ve just posted an answer in another topic, which I am going to quote here:

I hope this answers your question and gives you links to some good material to get you started. Once you go over some of the tutorials you are welcome to come back to the forums with more advanced questions.

The second part of this post is less happy and more of a disciplinary PSA that somebody have to say.

I’ve told @enothecool a couple of times in PM, and I will repeat it in open topic, since he seem to ignore my PMs.

Do not use VEX Forum as a chat platform!

Do not post multiple short messages in the rapid succession in the open topics.

This is one of the easiest ways to annoy forum moderators.

Take your time to write more thoughtful messages with rich formatting, including properly formatted code samples enclosed in the [code] ... [/code] tags, and links to the reference materials, when appropriate.

3 Likes