Cata code

Hi, I’m trying to code my data with the following. However, the cata does not seem to stop at the bumper switch.

    if (catabumper.get_value()){
      cata.move(0);
    
    }

    else{
      cata.move(-127);
    }

    if (master[ControllerDigital::R1].changedToPressed()){
      shooter_time = pros::millis();
      state = 1;
    }
    

    if (state == 1){
      cata.move(-127);
      if (pros::millis() - shooter_time > 300){
        state = 0;
      }
    }
1 Like

I was looking into a cata as well and can’t figure out the code…

did you make sure to say to do it forever?