int sensorState = 0; void setup() { pinMode(2, INPUT); pinMode(13, OUTPUT); Serial.begin(9600); } void loop() { // read the state of the sensor/digital input sensorState = digitalRead(7); // check if sensor pin is HIGH. if it is, set the // LED on. if (sensorState == HIGH) { digitalWrite(13, HIGH); Serial.println("Ryx!"); } else { Serial.println("Tixo!"); digitalWrite(13, LOW); } delay(10); // Delay a little bit to improve simulation performance }