top of page

Electronics

13/03/2023

שיעור 1 ריכבים.jpg

const int red_led_pin_ilanit=3; // red led light is attached

const int yellow_led_pin_ilanit=4;

const int green_led_pin_ilanit=5;

void setup() {

// put your setup code here, to run once:

pinMode(red_led_pin_ilanit, OUTPUT);

pinMode(yellow_led_pin_ilanit, OUTPUT);

pinMode(green_led_pin_ilanit, OUTPUT);

}

void loop() {

// put your main code here, to run repeatedly:

delay(600); // long break at the end

digitalWrite(red_led_pin_ilanit, HIGH);

delay(100); //red led is turning on

digitalWrite(red_led_pin_ilanit, LOW); //red led is turning off

delay(100); //red led is flickering fast - 100 milisecond

digitalWrite(yellow_led_pin_ilanit, HIGH); //yellow led is turning on

delay(100);

digitalWrite(yellow_led_pin_ilanit, LOW);

delay(100); //yellow led is flickering fast - 100 milisecond

digitalWrite(green_led_pin_ilanit, HIGH);

delay(100);

digitalWrite(green_led_pin_ilanit, LOW);

//green led is flickering fast - 100 milisecond

//כדי לשים בהערה פסקה שלמה - לשים כוכבית סלש ולסגור בסלש כוכבית.

}

bottom of page