Turn on LEDs by serial monitor via Bluetooth

Hi…
It is supposed that I write the letter L on the serial monitor and when I enter that letter I save it in an arduino with a bluetooth I established as master and from there I sent it to a bluetooth that I have as a slave, but I cannot do it.

Do not pair anything and the tx led does not light when I send you the letter. Help profavor

// MasterCodeArduinoUno

#include <SoftwareSerial.h>
SoftwareSerial SerialATtiny (0, 1);

void setup () {
  // Start routine
  pinMode (13, OUTPUT);
  digitalWrite (13, HIGH);
  delay (500);
  digitalWrite (13, LOW);
  delay (500);
 

  // Initiation of serial port for Bluetooth and Monitor
  Serial.begin (9600);
  SerialATtiny.begin (9600);
  Serial.println ("L = Left; C = Center; R = Rigth");


}

void loop ()
{
  if (Serial.available ())
  {
    char val = Serial.read (); // here I read what I wrote in the serial and store it in val
    SerialATtiny.write (val); // I send what is in val to the bluetooth as slave, it must receive it
    Serial.print ("Sent"); // I print to the serial monitor
   }
}

Sorry not enough information. Why not start by defining the problem with specifications including a flow chart and schematic. Define what is the expected outcome. Purchase the Arduino cookbook and read it, this will give you some basics. also use the online tutorials and videos available, there are many good ones on this web site. At this point you will be able to define the problem and may have already solved it. When you have the drawings and flow chart post them, I expect you will get a lot of help.

serial monitor ---> Arduino ---> Bluetooth ---> Bluetooth on another device ?

Which Bluetooth device are you using with your Arduino?

ieee488: serial monitor ---> Arduino ---> Bluetooth ---> Bluetooth on another device ?

Which Bluetooth device are you using with your Arduino?

I use two hc-05 bluetooth modules, one as a master and one as a slave, the master is connected to an arduino one that is connected to the computer, and the second slave bluetooth module is connected only to a mega arduino in another room. The problem is that the arduino master does not send what I write on the serial monitor, I have tried a lot but it does not work, sorry.

You should first try have the master HC-05 send to your smartphone's Bluetooth Terminal. If that works then you can proceed.

.

For starters, you are using software serial on the hardware serial pins 0,1, which is fatal, and you should remove it before you think of anything else. I’m guessing that an Arduino one is a Uno, or something like it, so you might consider swapping it with the Mega and

Serial monitor
:
: cable
:
Mega
hardware serial3 — Bluetooth>>>>Bluetooth — Uno hardware serial pins 0,1
:
:
does whatever

The Martyn Currey website has detail on Bluetooth<>Bluetooth connection.

thonyfmi:
Hi…
It is supposed that I write the letter L on the serial monitor and when I enter that letter I save it in an arduino with a bluetooth I established as master and from there I sent it to a bluetooth that I have as a slave, but I cannot do it.

Do not pair anything and the tx led does not light when I send you the letter. Help profavor

// MasterCodeArduinoUno

#include <SoftwareSerial.h>
SoftwareSerial SerialATtiny (0, 1);

void setup () {
  // Start routine
  pinMode (13, OUTPUT);
  digitalWrite (13, HIGH);
  delay (500);
  digitalWrite (13, LOW);
  delay (500);

// Initiation of serial port for Bluetooth and Monitor
  Serial.begin (9600);
  SerialATtiny.begin (9600);
  Serial.println (“L = Left; C = Center; R = Rigth”);

}

void loop ()
{
  if (Serial.available ())
  {
    char val = Serial.read (); // here I read what I wrote in the serial and store it in val
    SerialATtiny.write (val); // I send what is in val to the bluetooth as slave, it must receive it
    Serial.print (“Sent”); // I print to the serial monitor
  }
}

I had to put digital pins like rx and tx for it to work, thanks for everything

#include <SoftwareSerial.h>
  SoftwareSerial  SerialATtiny(10,11);//rx,tx
  char  val;

void setup() {
 
  //boot routine
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);
  delay(200);
  digitalWrite(13, LOW);
  delay(200);
  //Initiation of the serial port for the Bluetooth and Monitor
  Serial.begin(9600);
  SerialATtiny.begin(9600);
  Serial.println("Ready"); 


}

void loop()
{ 
  if(Serial.available())
  {
    val=Serial.read();
    if(val=='L'){
    Serial.print("ok ");
    SerialATtiny.write('L');
    delay(500);
    Serial.println("Bluetooth send");
  }
 }
}