Skip to content

Instantly share code, notes, and snippets.

@kingardor
Last active November 20, 2018 09:44
Show Gist options
  • Save kingardor/305291ab0e12f4b1a72e5e0bab90ba7c to your computer and use it in GitHub Desktop.
Save kingardor/305291ab0e12f4b1a72e5e0bab90ba7c to your computer and use it in GitHub Desktop.
Code to use HM-10 with Arduino/ESP8266
/*Method to enter AT
* Connections:
* Arduino/Esp8266 HM10
* GND GND
* 5V 5V
* RX RX
* TX TX
* Open Serial Monitor. Set the Baud to 9600 with NL&CR. Test for AT.
*/
#include <SoftwareSerial.h>
//For Arduino
//SoftwareSerial mySerial(8,9); // RX, TX
//For ESP
SoftwareSerial mySerial(12,13); // RX, TX
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() {
char c;
if (mySerial.available()) {
c = mySerial.read();
Serial.println("Got input:");
Serial.println(c);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment