Created
January 21, 2018 00:44
-
-
Save esmarr58/069ebb74aa84994013cf76ed6b9021bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://hetpro-store.com/TUTORIALES/configurando-maestro-o-como-esclavo/ | |
#include <SoftwareSerial.h> | |
#define RxD 11 | |
#define TxD 10 | |
#define KEY 9 | |
SoftwareSerial BTSerial(RxD, TxD); | |
void setup() | |
{ | |
pinMode(KEY, OUTPUT); | |
digitalWrite(KEY, HIGH); // Como se mencionó en configuración colocar a KEY en estado alto. | |
delay(500); | |
BTSerial.flush(); | |
delay(500); | |
BTSerial.begin(38400); // comunicación directa al Modulo. | |
Serial.begin(9600); // comunicación directa al Monitor. | |
Serial.println("Enter AT commands:"); | |
BTSerial.print("AT\r\n"); | |
delay(100); | |
} | |
void loop() | |
{ | |
if (BTSerial.available()) | |
Serial.write(BTSerial.read()); | |
if (Serial.available()) | |
BTSerial.write(Serial.read()); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment