Bu kodları dene 1K direnç kullan ve lightblue uygulamasını dene.
#İnclude <SoftwareSerial.h>
// Bluetooth modülü için pinler.
Softwareserial Bluetooth(10, 11); // RX, tx.
// LED için pin.
Const int ledpin = 13;
Void setup() {
Pinmode(ledpin, output);
Bluetooth. Begin(9600);
Serial. Begin(9600);
}
Void loop() {
İf (bluetooth.available()) {
String data = Bluetooth. Readstringuntil('\n');
Serial. Println(data);
İf (data == "on") {
Digitalwrite(ledpin, hıgh);
} Else if (data == "off") {
Digitalwrite(ledpin, Low);
}
}
}