PWM help on transmission controller

hello, i have written my first project which is a program to control a GM automatic transmission. everything works according to plan minus this one last item to address.

I have to create a PWM circuit of 50hz @90% duty cycle. this is the only PWM output i need at this time.

I have done some searching on changing the frequency but it turns out to be slightly above my level of knowledge at this point(read: this is my first arduino project)

i dont have an oscope readily available to check the output of this circuit either. so im wondering, is there an easy way to achive what im looking for?

thanks

You could look at the blink without delay example

ok using that i would need an 18ms on time and a 2 ms off time correct?

if i specify my long interval as 18ms, is it on for 18ms - off for 18ms? or do i need to specify off for 2 ms?

thanks

No, you need to change the value of interval when you change the state of the LED

so i couldnt figure out how to do it like you stated.

i was able to do it by commanding if on for 18ms and off for 2 ms (10ms for test purposes)

  if (currentGear == 2 || currentGear == 3 || currentGear == 4);
  digitalWrite(Sol32, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(18);               // wait for a second
    digitalWrite(Sol32, LOW);    // turn the LED off by making the voltage LOW
    delay(10);

now the issue when i go from 2nd to 3rd and 3rd to 4th, it turns the led off for the half second delay i have built into the button state change poll. so, when i command 2nd the led should be flashing. when i command 3rd the led should be flashing. but there is a half second pause where it is not flashing during gear change. i need it to stay flashing
here is a visual of the delay i have set in place. i have the delay there so that a button press only changes one gear unless the button is held for longer than half a second

    if (RbuttonState != RlastButtonState) {
      if (RbuttonState == 1 && currentGear == 1) {
        currentGear = 2;
        RlastButtonState = 1;
        Serial.println("2 on");
        delay(500);

the leds in my switch case will stay lit without going out for the half second if the pin state is common between the case values. . bellow is my switch case for gear change requirements.

  switch(currentGear) {
  case 1:
    digitalWrite(ledPin1,HIGH);      // turns on 1st gear feedback LED
    digitalWrite(SolA,HIGH);         // SolA on
    digitalWrite(SolB,HIGH);        // SolB on
    
    break;
  case 2:
    digitalWrite(ledPin2,HIGH);      // turns on 2nd gear feedback LED
    digitalWrite(SolA,LOW);        // SolA off
    digitalWrite(SolB,HIGH);         // SolB on
    break;
  case 3:
    digitalWrite(ledPin2,HIGH);      // turns on 3rd gear feedback LED
    digitalWrite(SolA,LOW);        // SolA off
    digitalWrite(SolB,LOW);        // SolB off
    break;
  case 4:
    digitalWrite(ledPin2,HIGH);      // turns on 4th gear feedback LED
    digitalWrite(SolA,HIGH);         // SolA on
    digitalWrite(SolB,LOW);        // SolB off
    break;

if i need to post the entire code let me know

cliffnotes: led that needs to be PWM needsd to remain on duffing switch case changes. LEds that are common between switch case changes stay lit without going out why cant the PWM one?