الكود البرمجي :
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
int bushbutton = 4;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
pinMode(bushbutton,INPUT);
digitalWrite(bushbutton,HIGH);
}
void loop() {
if ( digitalRead(bushbutton)==LOW){
digitalWrite(led, HIGH);
}
else{
digitalWrite(led,LOW);
}
}
// give it a name:
int led = 13;
int bushbutton = 4;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
pinMode(bushbutton,INPUT);
digitalWrite(bushbutton,HIGH);
}
void loop() {
if ( digitalRead(bushbutton)==LOW){
digitalWrite(led, HIGH);
}
else{
digitalWrite(led,LOW);
}
}
ليست هناك تعليقات:
إرسال تعليق