int R = 9; int G = 10; int B = 11; int renk; int gecikme = 1000; void setup() { pinMode(R, OUTPUT); pinMode(G, OUTPUT); pinMode(B, OUTPUT); Serial.begin(9600); } void loop() { renk = random(6); Serial.println(renk); switch (renk) { case 0: analogWrite(R, 0); analogWrite(G, 255); analogWrite(B, 255); delay(gecikme); break; case 1: analogWrite(R, 255); analogWrite(G, 0); analogWrite(B, 255); delay(gecikme); break; case 2: analogWrite(R, 255); analogWrite(G, 255); analogWrite(B, 0); delay(gecikme); break; case 3: analogWrite(R, 255); analogWrite(G, 0); analogWrite(B, 0); delay(gecikme); break; case 4: analogWrite(R, 0); analogWrite(G, 255); analogWrite(B, 0); delay(gecikme); break; case 5: analogWrite(R, 0); analogWrite(G, 0); analogWrite(B, 255); delay(gecikme); break; } }