switch the use of two pins with counts??

Im planning a project the uses two relays for fan controllers. Relay1 on at temp X and Relay 2 at temp Y.

Im looking for a simple solution in programming to make Relay 1 and Relay 2 switch places.
for example… in the globals,
int Relay1 = 4;
int Relay2 = 5;

I would like to make Relay1 = 5 and Relay2 = 4 then be able to switch back and forth depending on counts of Relay actions…

The purpose is to hopefully reduce wear on my relays and fan motors

I am not sure exactly clear what you want to do, but as long as you don't declare the relay variables as const then you can change their values as often and anywhere you want so what is the problem ?

Why not do this logically in software?

Blackfin:
Why not do this logically in software?

that's what I was asking.
Im looking for suggestions on a simple way to write it.

Do you have a sketch showing where you are now?

No, the idea hit me and I haven't wrote any software yet.

You need an "alternator", if fan1 was the last to run, start fan2 and vise versa.
Pseudo code:

static bool fan1 = false;
if(temp > setpoint)
{
  if(fan1)
 {
    start fan2;
    fan1 = false;
 }
 else
 {
    start fan1;
    fan1 = true;
 }
}

LandonW:
The purpose is to hopefully reduce wear on my relays and fan motors

Reduce, or equalize?

Equalized is a better word

A simple way to code this is to record which fan was last active, then consult this when deciding which
fan to activate next.