Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esmarr58/069ebb74aa84994013cf76ed6b9021bb to your computer and use it in GitHub Desktop.
Save esmarr58/069ebb74aa84994013cf76ed6b9021bb to your computer and use it in GitHub Desktop.
//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