Introduction - If you have any usage issues, please Google them yourself
Proteus single-chip microcomputer simulation- relay
# include < reg51. H >
Sbit S1 P3 ^ 2
Sbit S2 P3 ^ 3
Sbit Relay P0 ^ 0
Void main ()
{
While (1)
{
If (S1 0) Relay 1
If (S2 0) Relay 0
}
}