Malzemeler:
- Arduino Uno
- 3 renk LED
- 10K Potansiyometre
int kirmizi=12; int sari=11; int yesil=10; int pot=A0; int potDeger; void setup(){ pinMode(kirmizi,OUTPUT); pinMode(sari,OUTPUT); pinMode(yesil,OUTPUT); } void loop(){ potDeger=analogRead(pot); potDeger=map(potDeger, 0, 1023, 2000, 6000); delay(10); lamba(potDeger); } void lamba(int sure){ digitalWrite(kirmizi,HIGH); delay(sure); digitalWrite(sari,HIGH); delay(1000); digitalWrite(kirmizi,LOW); digitalWrite(sari,LOW); digitalWrite(yesil,HIGH); delay(sure); digitalWrite(yesil,LOW); digitalWrite(sari,HIGH); delay(1000); digitalWrite(sari,LOW); digitalWrite(kirmizi,HIGH); }