//LEDs proportional zur Joystickposition ansteuert
int xPin = 34;
int yPin = 35;
int led1Pin = 2;
int led2Pin = 4;
void setup() {
pinMode(led1Pin, OUTPUT);
pinMode(led2Pin, OUTPUT);
pinMode(xPin, INPUT);
pinMode(yPin, INPUT);
}
void loop() {
int xValue = analogRead(xPin);
int yValue = analogRead(yPin);
int led1Brightness = map(xValue, 0, 1023, 0, 255);
int led2Brightness = map(yValue, 0, 1023, 0, 255);
analogWrite(led1Pin, led1Brightness);
analogWrite(led2Pin, led2Brightness);
}