I have an Arduino UNO R4 Wifi, but it has its embedded Bluetooth module of type LE (Low Energy), currently I have this code that receives a value 1 or 0 through an interface that I made in Python using PyQT6, and the serial release , the problem is that I can't connect my arduino to my computer via bluetooth because it doesn't detect it and when it detects it, it tells me "Error trying to connect, try again", this is my code.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);
void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
Serial.println("Arduino connected");
mySerial.begin(38400);
}
void loop() {
if (mySerial.available() > 0) {
String command = mySerial.readStringUntil('\n');
if (command == "0") {
digitalWrite(13, LOW);
Serial.println("LED OFF");
} else if (command == "1") {
digitalWrite(13, HIGH);
Serial.println("LED ON");
}
Serial.print("> ");
Serial.println(command);
}
if (Serial.available()) {
mySerial.write(Serial.read());
}
}