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

Return to the regular view of this page.

User Input

User input components will wait for a user to interact with them.

1 - Button

A button will detect if a user presses it.
Information

Type : User Input

Mode : Digital

Pins : 0-14

Output Values : 0-1

Tutorial : funduino

Image by funduino, CC-BY-SA.

Connection scheme

Scheme made with Fritzing.

Functions

Await Input

Await Input State

Awaits a digital value.

void function_0_button(){
int value = digitalRead(pin_0_button);
delay(200);
function_0_button();
}
  
int value = digitalRead(pin_0_button);
delay(200);
  
void function_0_button(){
int value = digitalRead(pin_0_button);
delay(200);
state = 1;
}
  

2 - Switch

A switch works similar to a button to detect an input.
Information

Type : User Input

Mode : Digital

Pins : 0-14

Output Values : 0-1

Tutorial : funduino

Note: A switch works the same way as a button but you can always the the current status.

Image by funduino, CC-BY-SA.

Connection scheme

Scheme made with Fritzing.

Functions

Await Input

Await Input State

Awaits a digital value.

void function_0_Schalter(){
int value = digitalRead(pin_0_switch);
function_0_Schalter();
}
  
int value = digitalRead(pin_0_switch);
  
void function_0_Schalter(){
int value = digitalRead(pin_0_switch);
state = 1;
}
  

3 - Slider

A slider returns a value based on its position.
Information

Type : User Input

Mode : Analog

Pins : 0-7 (analog)

Output Values : 0-1023

Tutorial : funduino

Image by funduino, CC-BY-SA.

Connection scheme

Scheme made with Fritzing.

Functions

Await Input

Await Input State

Awaits a analog value.

void function_0_Schieberegler(){
int value = analogRead(pin_0_slider);
function_0_Schieberegler();
}
  
int value = analogRead(pin_0_slider);
  
void function_0_Schieberegler(){
int value = analogRead(pin_0_slider);
state = 1;
}
  

4 - Potentiometer

A potentiometer returns a dynamic value based on the rotation.
Information

Type : User Input

Mode : Analog

Pins : 0-7 (analog)

Output Values : 0-1023

Tutorial : funduino

Image by funduino, CC-BY-SA.

Connection scheme

Scheme made with Fritzing.

Functions

Await Input

Await Input State

Awaits a analog value.

void function_0_Potentiometer(){
int value = analogRead(pin_0_potentiometer);
function_0_Potentiometer();
}
  
int value = analogRead(pin_0_potentiometer);
  
void function_0_Potentiometer(){
int value = analogRead(pin_0_potentiometer);
state = 1;
}