Relay

A relay can be used to turn another electrical component on and off.
Information

Type : Output

Mode : Digital

Pins : 0-14

Tutorial : funduino

Note: Be careful with external energy sources!

Image by funduino, CC-BY-SA.

Connection scheme

Scheme made with Fritzing.

Functions

On

On State

Switches the component on.

void function_0_relay(){
digitalWrite(pin_0_relay, HIGH);
function_0_relay();
}
  
digitalWrite(pin_0_relay, HIGH);
  
void function_0_relay(){
digitalWrite(pin_0_relay, HIGH);
state = 1;
}
  

Off

Off State

Switches the component off.

void function_0_relay(){
digitalWrite(pin_0_relay, LOW);
function_0_relay();
}
  
digitalWrite(pin_0_relay, LOW);
  
void function_0_relay(){
digitalWrite(pin_0_relay, LOW);
state = 1;
}
  

Last modified April 6, 2022: added component translations (dd86b1f)