how I can controller two power

I have a problem. How do I control the two voltage sources connected to the same thing conditionally with the relay. When the voltage rises above 6 volts, I want the first voltage source to deactivate and the second voltage source is activated.

What have you tried ?

Connect one source to the NC relay terminal and the other to the NO terminal. Read the voltage and switch the relay on or off depending on it's value. Job done.

Steve

what did you said. I did not understand

slipstick:
Connect one source to the NC relay terminal and the other to the NO terminal. Read the voltage and switch the relay on or off depending on it's value. Job done.

Steve

what is the this code

A simple question

Have you written any code for this project ?
If so then please post it here after reading Read this before posting a programming question