top of page
KADAFI1_edited.jpg

int led_red = 0; // the red LED is connected to Pin 0 of the Arduino
int led_yellow = 1; // the yellow LED is connected to Pin 1 of the Arduino
int led_green = 2; // the green LED is connected to Pin 2 of the Arduino

void setup() {
// set up all the LEDs as OUTPUT
pinMode(led_red, OUTPUT);
pinMode(led_yellow, OUTPUT);
pinMode(led_green, OUTPUT);
}

void loop() {
// turn the green LED on and the other LEDs off
digitalWrite(led_red, LOW);
digitalWrite(led_yellow, LOW);
digitalWrite(led_green, HIGH);
delay(2000); // wait 2 seconds

// turn the yellow LED on and the other LEDs off
digitalWrite(led_red, LOW);
digitalWrite(led_yellow, HIGH);
digitalWrite(led_green, LOW);
delay(1000); // wait 1 second

// turn the red LED on and the other LEDs off
digitalWrite(led_red, HIGH);
digitalWrite(led_yellow, LOW);
digitalWrite(led_green, LOW);
delay(3000); // wait 3 seconds
}

tumelo_edited.jpg

const int LED=13;
int val=0; 
void setup(){ 
  pinMode(LED, OUTPUT);  
  pinMode(7, INPUT);     
}
void loop(){
val=digitalRead(7);
  if(val==HIGH)
{
    digitalWrite(LED,HIGH);
}
else

    digitalWrite(LED,LOW);  
}
delay(1000);
}

9f9d2e145a6d3e3eb9b415765d67845.jpg

const int LED=13;
int val=0;
void setup(){
pinMode(LED, OUTPUT);
pinMode(7, INPUT);
}
void loop(){
val=digitalRead(7);
if(val==HIGH)
{
digitalWrite(LED,HIGH);
}
else
{
digitalWrite(LED,HIGH);
}
delay(1000);
}

bottom of page