switch to pushbuton

I see many sketch's for push-button to switch...

But how do you do switch to push-button on switch state with two channel out put

Can you describe in logical terms what you mean?

AWOL:
Can you describe in logical terms what you mean?

Well English would be a good start.

I'm sorry...I thought it would have been self-explanatory.

A switch is either ON (closed contact) or OFF (open contact)..being the Input

State being On (closed) or Off (open)

The desired Output being a momentary (push-button) for each State of the switch.

One momentary out on switch closed (channel 1)...and One momentary out on switch open (channel 2)

"switch to push-button on switch state with two channel out put"

Is that better?

It sounds like you are referring to a momentary push button to toggle the state of something like a D Flip flop? Push button, FF sets, push again, FF resets.

... or perhaps you mean that you have a toggle switch that will rest in the ON or OFF position. You would like the single input from this switch to control several outputs. One output goes high when the switch is in the ON position. The other goes high when the switch is in the OFF position. These outputs essentially toggle as the switch is flipped. In summary, you would like to convert SPST to SPDT.

... or perhaps same as above except that OutputA pulses once when the switch flipped ON and OutputB pulses once when the switch is flipped OFF.

... or ...

"or perhaps same as above except that OutputA pulses once when the switch flipped ON and OutputB pulses once when the switch is flipped OFF."

yes...

Doesn't sound too difficult. You'll need to detect if the input has changed state, then check the actual state, then pulse the desired output for the required time. It's good to use the millis() timer instead of delay().

What code do you have so far?

None…Trying to learn this on the fly…I have better luck using a similar sketch/program and modifying
it to my needs but can only find push-button to switch…not …switch to push-button…with 2 outputs

Something to work with. Untested, no debounce. Use BlinkWithoutDelay example for additional reference. Connect your switch from inputPin to GND.

const byte outputPinA = 13;
const byte outputPinB = 12;
const byte inputPin = 11;

byte inputState = HIGH, previousInputState = HIGH;

const unsigned long interval = 250;
unsigned long currentMillis, previousMillis = 0;

void setup() {
  pinMode(outputPinA, OUTPUT);
  pinMode(outputPinB, OUTPUT);
  pinMode(inputPin, INPUT_PULLUP);
}

void loop() {
  inputState = digitalRead(inputPin);
  currentMillis = millis();

  if (inputState != previousInputState) {            // if the input switch position has changed
    previousInputState = inputState;                 // update previousInputState 
    previousMillis = currentMillis;                  // reset the time interval
    digitalWrite(outputPinA, !inputState);           // update outputPinA
    digitalWrite(outputPinB, inputState);            // update outputPinB
  }

  if (currentMillis - previousMillis >= interval) {  // if time interval has expired
    previousMillis = currentMillis;                  // reset the time interval
    digitalWrite(outputPinA, LOW);                   // reset outputPinA
    digitalWrite(outputPinB, LOW);                   // reset outputPinB
  }
}

nineball:
Is that better?

Judging from my point of view and also the responses you have got so far I would say no.

/*
  trying diff stuff and commenting out previous
*/


// the setup function runs once when you press reset or power the board
  //#define CH1 8           // Connect Digital Pin 8 to CH1 on Relay Module for ON command
  //#define CH2 9           // Connect Digital Pin 9 to CH2 on Relay Module for OFF command
  //#define StatState 2     // T-stat input on pin 2 high or low

const  int CH1 = 8;           // Connect Digital Pin 8 to CH1 on Relay Module for ON command
const  int CH2 = 9;           // Connect Digital Pin 9 to CH2 on Relay Module for OFF command
const  int TStat = 2;     // T-stat input on pin 2 high or low
       int StatState = digitalRead(TStat);
       int CH1state = digitalRead(CH1);
       int CH2state = digitalRead(CH2);
void setup() {
  Serial.begin(9600);     // Start serial read
 // while (!Serial);       // Wait for connect
  
  pinMode(CH1,OUTPUT);  // Relay 1 for On command
  pinMode(CH2,OUTPUT);  // Realy 2 for OFF command
  pinMode(TStat,INPUT);    // T-stat open/close contact input
  //digitalWrite(TStat,LOW);
}

// the loop function runs over and over again forever
void loop() {
  Serial.print ("CH1:  ");
  Serial.println (CH1state );
  delay (2000);
  //Serial.println (CH2state);
  Serial.print ("StateState:  ");
  Serial.println (StatState);
  //digitalWrite (CH1, LOW);
  //digitalWrite (CH2, LOW);
  if (StatState == 1)  {      // Calling for Heat contact closed
  digitalWrite (CH1,1);                           // Turn Stove ON
  Serial.print ("CH1:  ");
  Serial.println (CH1state );
  delay (2000);                                          // pause
  digitalWrite (CH1,0);                            // Toggle relay back off
  delay (2000);       }
  
else if (StatState == LOW);{}

  
//if (digitalRead(StatState == LOW && CH2 == false));  // Not Calling for Heat contact open
  //digitalWrite (CH2, HIGH);                           // Turn Stove OFF
  //delay (2);                                          // pause
  //digitalWrite (CH2, LOW);                            // Toggle relay back off

   

}

Getting there ...but I need to stop the loop untill next state change...and return the relays to normal (off) until the next state change

but I need to stop the loop untill next state change

It is a micro controller, you can not stop anything, it keeps on going. What you have to do is to side step the code until the next state change which can be done with an if statement.

easier said than done...at my my tage of the game....but thanks for the direction

so what would the argument be to wait for the next state change....

apparently it needs to look at last state....which I tried to put back to OFF...so if OFF do nothing

but that didn't work....and i get diff loops depending on the input state when uploaded
obviously...I'm missing something

so what would the argument be to wait for the next state change

What indicates the state should change?

but that didn't work

OK the way this forum works is that if you make changes that don't work and you want to know why you post the new code and say what you want to happen and say what does happen.