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:
- Change the transmitter delay, or to remove the same
- I've modified the speeds and tried all possible serial speeds from 300 to 115200 ....
- 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.