বাটন চাপলে বাতি জ্বলেButton turns on a light
যা যা লাগবে · Parts you need
তার লাগানো · Wiring
| Arduino Uno D2 | → | Push button 1 |
| Push button 2 | → | Arduino Uno GND.3 |
Code (Arduino C++)
// Press the button: the L LED turns on
const int buttonPin = 2;
void setup() {
pinMode(buttonPin, INPUT_PULLUP); // pressed = LOW
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (digitalRead(buttonPin) == LOW) {
digitalWrite(13, HIGH);
} else {
digitalWrite(13, LOW);
}
}
ভিডিও · Videos
আরো project · More projects