ফোন দিয়ে LED চালাও (HC-05 Bluetooth)Phone controls an LED (HC-05 Bluetooth)
যা যা লাগবে · Parts you need
তার লাগানো · Wiring
| Bluetooth module (HC-05) VCC | → | Arduino Uno 5V |
| Bluetooth module (HC-05) GND | → | Arduino Uno GND |
| Bluetooth module (HC-05) TXD | → | Arduino Uno D10 |
| Bluetooth module (HC-05) RXD | → | Arduino Uno D11 |
Code (Arduino C++)
#include <SoftwareSerial.h>
SoftwareSerial bt(10, 11); // RX, TX
void setup() {
pinMode(13, OUTPUT);
bt.begin(9600);
bt.println("Send 1 = ON, 0 = OFF");
}
void loop() {
if (bt.available()) {
char c = bt.read();
if (c == '1') { digitalWrite(13, HIGH); bt.println("LED ON"); }
if (c == '0') { digitalWrite(13, LOW); bt.println("LED OFF"); }
}
}
ভিডিও · Videos
আরো project · More projects