How do you code a flywheel

My whole team isn´t here and I’m not the programer and i have to program our flywheel for states help please

ok first: determine what type of vex code your robots program uses. If its Vexcode blocks, then itll be much easier for you. If its Vexcode pro, then there should be tutorials on youtube or posts from older parts of the vex forum that explain how to code the flywheel. And above all, contact your teammates. They most likely know how to code it, so if you can call them in some way, or send them the code, then everything will be out of your hands and youll be good to go.

1 Like

My code is going to be in blocks but i found a code already and its in text if this code doesnt work out im going to look it up but thanks much love by 6390H

1 Like

Screenshot 2023-02-21 8.16.05 PM

i just run an if-else

if(button pressed)
{flywheel go brrr}
else
{flywheel no go brrr}

and i use a pid so that helps with consistency alot but we were fine earlier in the season w/o a pid tbh

we also did some fanci stuff with flywheel

void flywheel control() {
  if (R1 && R2) {
    indexer true
  } else if (R1) {
    indexer false
    flywheel lower speed
  } else if (R2) {
    indexer false
    flywheel higher speed
  } else {
    indexer false
    flywheel stop
  }
}
2 Likes

Im trying to code in blocks and i cant find the set blank false/true blocks

Assuming you were to have an indexer, you would use
image
this, most likely.

You don’t use that for the flywheel.

Set (blank) false and true are for the boolean used for this application. You can find them in the variables tab in Vex V5 block code.

This will make it so when you press x the flywheel will spin forward, if it spins backward than press the up and down arrows by the word flywheel on the controller 1 screen, you won’t be able to stop the flywheel but your coder can fix that if/when they have time


Second photo for my last response

With these controls I think the flywheel would only spin while the buttons are pressed

Yeah, sorry that is how it works, I miss explained it, thanks for pointing that out, I confused myself