need help with my project using an arduino nano and IR for controlling devices

Good evening guys,
need help with my project, where i want to control my stereo system with an arduino nano and an IR-diode. I want the on/off signal to be sended when there is an signalchange on Port 6 because i want to put a switch there which stays High or Low and changes when pressing once. So the signal need to be sended once there is a signalchange and should not be sended all the time because then the stereo system would permanentely going on and off. When i compile the code it says no error and everything looks fine. I also connected everything correct. Here you can see my code:

define stereo 6 // nehmen wir mal an, Pin 6

boolean switchstereoChanged() {
static int oldState = LOW; // oder auch HIGH, je nachdem

int currentState = digitalRead(stereo);
if(currentState == oldState) //wenn low dann= low
return false;
oldState = currentState;
return true;
}
#include <IRremote.h>
IRsend irsend;

void setup()
{

}

void loop()
{
if (switchstereoChanged()) {
unsigned int rawData[99] = {3350,1600, 400,450, 400,450, 350,1300, 400,450, 350,1300, 400,400, 400,1300, 350,450, 400,450, 400,1250, 400,450, 400,400, 400,1300, 350,1300, 400,450, 350,450, 400,450, 350,450, 400,450, 350,500, 350,1300, 400,400, 400,1300, 350,450, 400,1300, 350,450, 400,450, 350,450, 400,1300, 350,1300, 400,450, 350,450, 400,450, 400,400, 400,450, 400,450, 350,450, 350,500, 400,1250, 400,450, 400,1250, 400,450, 350,450, 350,500, 400,450, 350,1300, 350,450, 400,450, 400}; // NEC 4B36D32C
irsend.sendRaw(rawData, sizeof(rawData) / sizeof(rawData[0]), 38);

}
}

Would be nice if somebody could answer me fastly.
Good evening
greetings

Lukas

Abend

Is this an IBM 360 question?

TolpuddleSartre:
Is this an IBM 360 question?

The OP needs to be moved to the German language forum.