This the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Output

Output components like LEDs or buzzers do not take an input but instead manipulate their environment.

1 - LED

A LED commonly used with a resistor emits light.
Information

Type : Output

Mode : Digital

Pins : 0-14

Tutorial : funduino

Note: Use with a resistor!

Image by funduino, CC-BY-SA.

Connection scheme

Scheme made with Fritzing.

Functions

On

On State

Switches the component on.

void function_0_led(){
digitalWrite(pin_0_led, HIGH);
function_0_led();
}
  
digitalWrite(pin_0_led, HIGH);
  
void function_0_led(){
digitalWrite(pin_0_led, HIGH);
state = 1;
}
  

Off

Off State

Switches the component off.

void function_0_led(){
digitalWrite(pin_0_led, LOW);
function_0_led();
}
  
digitalWrite(pin_0_led, LOW);
  
void function_0_led(){
digitalWrite(pin_0_led, LOW);
state = 1;
}
  

2 - Buzzer

A buzzer will emit a sound.
Information

Type : Output

Mode : Digital

Pins : 0-14

Tutorial : funduino

Note: Use tone(buzzer, 1000) to set the tone height.

Image by funduino, CC-BY-SA.

Connection scheme

Scheme made with Fritzing.

Functions

On

On State

Switches the component on.

void function_0_buzzer(){
digitalWrite(pin_0_buzzer, HIGH);
function_0_buzzer();
}
  
digitalWrite(pin_0_buzzer, HIGH);
  
void function_0_buzzer(){
digitalWrite(pin_0_buzzer, HIGH);
state = 1;
}
  

Off

Off State

Switches the component off.

void function_0_buzzer(){
digitalWrite(pin_0_buzzer, LOW);
function_0_buzzer();
}
  
digitalWrite(pin_0_buzzer, LOW);
  
void function_0_buzzer(){
digitalWrite(pin_0_buzzer, LOW);
state = 1;
}
  

3 - Vibration Motor

A vibration motor will vibrate and is for example used in a smartphone.
Information

Type : Output

Mode : Digital

Pins : 0-14

Tutorial : elektro.turanis.de

Image by funduino, CC-BY-SA.

Connection scheme

Scheme made with Fritzing.

Functions

On

On State

Switches the component on.

void function_0_vibrationMotor(){
digitalWrite(pin_0_vibrationMotor, HIGH);
function_0_vibrationMotor();
}
  
digitalWrite(pin_0_vibrationMotor, HIGH);
  
void function_0_vibrationMotor(){
digitalWrite(pin_0_vibrationMotor, HIGH);
state = 1;
}
  

Off

Off State

Switches the component off.

void function_0_vibrationMotor(){
digitalWrite(pin_0_vibrationMotor, LOW);
function_0_vibrationMotor();
}
  
digitalWrite(pin_0_vibrationMotor, LOW);
  
void function_0_vibrationMotor(){
digitalWrite(pin_0_vibrationMotor, LOW);
state = 1;
}
  

4 - 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;
}
  

5 - Servo

A servo is a small motor that can be turned.
Information

Type : Output

Mode : Servo Library

Pins : 0-14

Tutorial : funduino

Library: You need to import the servo library to use this component!

Note: Use with delay as the rotation takes some time.

Image by funduino, CC-BY-SA.

Connection scheme

Scheme made with Fritzing.

Functions

Degree

Turn servo to 0 degree

Turn servo to 180 degree

This function will turn the servo to the degree specified in the function name.

void function_1_servo(){
servo_0.write(0);
function_1_servo();
}
  
servo_0.write(0);
  
void function_0_servo(){
servo_0.write(0);
state = 1;
}