int poti;
const int btnBlau = 2;
const int btnGruen = 3;
const int btnRot = 4;
const int blau = 9;
const int gruen = 10;
const int rot = 11;
void setup() {
// put your setup code here, to run once:
pinMode(A1, INPUT);
pinMode(btnBlau, INPUT);
pinMode(btnGruen, INPUT);
pinMode(btnRot, INPUT);
pinMode(rot, OUTPUT);
pinMode(gruen, OUTPUT);
pinMode(blau, OUTPUT);
Serial.begin(9600);
Serial.println("Begin");
}
void loop() {
// put your main code here, to run repeatedly:
poti = map(analogRead(A1), 0, 1023, 0, 255);
if(digitalRead(btnBlau) == HIGH){
analogWrite(blau, poti);
Serial.print("Blau: ");
Serial.println(poti);
}
if(digitalRead(btnGruen) == HIGH){
analogWrite(gruen, poti);
Serial.print("Grün: ");
Serial.println(poti);
}
if(digitalRead(btnRot) == HIGH){
analogWrite(rot, poti);
Serial.print("Rot: ");
Serial.println(poti);
}
}