#define RotPin 6
#define GruenPin 5
#define BlauPin 3
#define S1 2
#define S2 4
#define S3 7
#define PotiPin A0
int RotWert, GruenWert, BlauWert, PotiWert;
void setup() {
pinMode(S1 , INPUT_PULLUP);
pinMode(S2 , INPUT_PULLUP);
pinMode(S3 , INPUT_PULLUP);
pinMode(RotPin , OUTPUT);
pinMode(GruenPin , OUTPUT);
pinMode(BlauPin , OUTPUT);
RotWert=0;
GruenWert=0;
BlauWert=0;
}
void loop() {
PotiWert=analogRead(PotiPin);
if(!digitalRead(S1))
{
RotWert=PotiWert/4;
}
if(!digitalRead(S2))
{
GruenWert=PotiWert/4;
}
if(!digitalRead(S3))
{
BlauWert=PotiWert/4;
}
analogWrite(RotPin, RotWert);
analogWrite(GruenPin, GruenWert);
analogWrite(BlauPin, BlauWert);
}