Last active
July 11, 2018 08:16
Configuración Modulo Bluetooth HC 06 En la linea 18, debemos probar con y sin salto de linea de la siguiente forma ----> BT1.println(S); // Con Salto de linea para firmware VERSION:3.0-20170609 ----> BT1.print(S); // Sin salto de linea para firmware linvorV1.8
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
#include <SoftwareSerial.h> | |
SoftwareSerial BT1(10,11); // RX, TX recordar que se cruzan | |
void setup() | |
{ | |
Serial.begin(9600); | |
Serial.println("Enter AT commands:"); | |
BT1.begin(9600); | |
} | |
void loop() | |
{ | |
if (BT1.available()) | |
Serial.write(BT1.read()); | |
if (Serial.available()) | |
{ String S = GetLine(); | |
BT1.println(S); // Si no está respondiendo el Bluetooth quitar salto de linea osea, cambiar por BT1.print(S); | |
Serial.println("---> " + S); | |
} | |
} | |
String GetLine() | |
{ String S = "" ; | |
if (Serial.available()) | |
{ char c = Serial.read(); ; | |
while (c != '\n') //Hasta que el caracter sea intro | |
{ S = S + c ; | |
delay(25) ; | |
c = Serial.read(); | |
} | |
return( S ) ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment