Tinkercad.com virtual laboratoriya yordamida LED(fotodiodni yoqib o‘chirish, 1 va 2 ta fotodiodni yoqib o‘chirish va svetofor dasturini tuzish) va Arduino kit yordamida yig‘ish va ishlatish.
// Pinlar
const int redPin = 7;
const int yellowPin = 6;
const int greenPin = 5;
void setup() {
// Pinlarni chiqarish rejimiga o'tkazish
pinMode(redPin, OUTPUT);
pinMode(yellowPin, OUTPUT);
pinMode(greenPin, OUTPUT);}
void loop() {
// Qizil digitalWrite(redPin, HIGH);
delay(3000);
digitalWrite(redPin, LOW);
// Sariq digitalWrite(yellowPin, HIGH);
delay(1000);
digitalWrite(yellowPin, LOW);
// Yashil digitalWrite(greenPin, HIGH);
delay(3000);
digitalWrite(greenPin, LOW);
// Sariq
digitalWrite(yellowPin, HIGH);
delay(1000);
digitalWrite(yellowPin, LOW);
}