Flywheel Speed Control

Hey guys
I want to make a flywheel speed control where if a button is pressed, the flywheel speed goes up in increments and if a different button is pressed the flywheel speed goes down in increments…any suggestions?

There are many examples of both this and other flywheel control methods on the forum, however, what you are describing would be something like this.

#pragma config(Motor,  port9,            ,             tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
    bool  buttonPressed = false;
    int motorSpeed = 0;
  
    while(1)
      {
      if( vexRT Btn8R ] )
        motorSpeed = 50;   // Some preset speed to start
      else
      if( vexRT Btn8U ] && !buttonPressed )
        {
        buttonPressed = true;
        motorSpeed += 5;  // increment
        }
      else
      if( vexRT Btn8D ] && !buttonPressed )
        {
        buttonPressed = true;
        motorSpeed -= 5;  // decrement
        }
        
      if( !vexRT Btn8U ] && !vexRT Btn8D ] )
        buttonPressed = false;
      
      // clip to valid values
      if( motorSpeed <   0 ) motorSpeed = 0;
      if( motorSpeed > 120 ) motorSpeed = 120;
      
      motor port9 ] = motorSpeed;
    
      wait1Msec(25);
      }
}