Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- SoftwareSerial BTserial(10, 11); // RX | TX
- char c = '-';
- char d = '-';
- void setup()
- {
- Serial.begin(9600);
- Serial.println("Arduino is ready");
- // HC-05 default serial speed for commincation mode is 9600
- BTserial.begin(9600);
- }
- void loop()
- {
- // Keep reading from HC-05 and send to Arduino Serial Monitor
- if (BTserial.available())
- {
- c = BTserial.read();
- Serial.write(c);
- }
- // Keep reading from Arduino Serial Monitor and send to HC-05
- if (Serial.available())
- {
- d = Serial.read();
- BTserial.write(d);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement