User manual
Ausgabe 19.05.2017 Copyright by Joy-IT 9
int val; // defines variable “Val”
int ledpin=13; // defines digital interface 13
void setup()
{
Serial.begin(9600); // sets baudrate to 9600 to comply
// with software configurationre
pinMode(ledpin,OUTPUT); // sets digital PIN 13 to output.
// This configuration is requi
//red when using I/O ports.}
void loop()
{
val=Serial.read(); // reads symbols and assigns to „Val“
if(val=='R') // checks input for the letter „R“
{ // if so, turn on LED at PIN 13
digitalWrite(ledpin,HIGH);
delay(500);
digitalWrite(ledpin,LOW); // turns off LED
delay(500);
Serial.println("Hello World!"); // shows “Hello World”
}
}