Remote control by Bluetooth HC 05 for Arduino via serial

Hello, I build a remote control by Bluetooth connecting two Arduino.

I'm using:

2 Bluetooths HC 05
1 Arduino Uno
1 Arduino Micro

Well, in the Arduino Uno I am using it as a data transmitter (remote control) and the Arduino Micro am using it as a data receiver. Both have a matched set and Bluetooth (Bluetooth Arduino Uno in Master and Slave in Bluetooth Arduino Micro).

In the Arduino Uno (transmitter) :

#include <SoftwareSerial.h>

void setup() {

pinMode(6,INPUT_PULLUP);
pinMode(7,INPUT_PULLUP);

Serial.begin(9600);

}

void loop(){

if(!digitalRead(6)){

delay(37);
Serial.print("A");

}

if(!digitalRead(7)) {

delay(37);

Serial.print("B");
}

}


In Arduino Micro (receiver):

#include <SoftwareSerial.h>

void setup(){
Serial1.begin(9600);
Serial.begin(9600);

Keyboard.begin();
}

void loop(){
if (Serial1.available() > 0) {

char myData = Serial1.read();
Keyboard.write(myData);

}
}

Well, the connections are working. I can send to computer the characters A and B (Sketch Arduino transmitter), but I would like to improve VOID LOOP of Arduino transmitter.

After all work properly, I need to send CHARACTER SPEED DEFAULT WINDOWS SYSTEM is exactly like the standard speed that we have in our keyboards. However, the speed of SERIAL Arduino is that needs to be adjusted.

What I've tried:

  1. Change the transmitter delay, or to remove the same
  2. I've modified the speeds and tried all possible serial speeds from 300 to 115200 ....
  3. I changed the speed of Bluetooth HC 05 with AT commands from 300 to 115200 ...

If I can adjust the serial speed to equal the same windows characters repetition rate only the Arduino transmitter without having to connect with each other , i'll be so glad.

:wink:

In the Arduino Uno (transmitter) :

#include <SoftwareSerial.h>

Why? You don't include Stepper.h, even though you don't use it, either.

After all work properly, I need to send CHARACTER SPEED DEFAULT WINDOWS SYSTEM is exactly like the standard speed that we have in our keyboards.

Then you need different hardware. Serial data transmission is NOWHERE near as fast.

Have you actually tried a bluetooth keyboard? Nowhere near as fast as a hardwired keyboard, either.

On the other hand, Serial can operate at least 12 times as fast as you are sending data now.

#include <SoftwareSerial.h> 
     
void setup(){
   Serial1.begin(9600);
   Serial.begin(9600);

I think you just playing around and guessing. You might get a better start here

PaulS:
Why? You don't include Stepper.h, even though you don't use it, either.
Then you need different hardware. Serial data transmission is NOWHERE near as fast.

Have you actually tried a bluetooth keyboard? Nowhere near as fast as a hardwired keyboard, either.

On the other hand, Serial can operate at least 12 times as fast as you are sending data now.

I agree with you, i tried a lot of libraries. I beleive thats better way is Bluefruit.

Nick_Pyner:

#include <SoftwareSerial.h> 

void setup(){
  Serial1.begin(9600);
  Serial.begin(9600);




I think you just playing around and guessing. You might get a better start here

http://phillipecantin.blogspot.com.au/2014/08/hc-05-bluetooth-link-with-zero-code.html

Im guessing some values, but no success, but the main problem is the serial speed answers. The bluetooth connection is ok.

willindows:
The bluetooth connection is ok.

At best, the smallest modicum of success you have had is entirely due to luck and you haven't the faintest idea of what you are doing. You even seem to be agreeing with somebody who is trying make you look like an idiot. It might pay to read replies #1, #2 again. At least all your commands about speed are the same speed, even the redundant ones, but, if they are too slow, you need to go into AT mode and reconfigure the modules to run at 115200. It may not be fast enough for you, but it's one hell of an improvement over what you've got.

Thanks for help everyone.

I solved my problem by this video.