Skip to content

Instantly share code, notes, and snippets.

@karesztrk
Forked from kingardor/hm10.ino
Created February 15, 2018 10:05
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karesztrk/a2e479d69985a7e9e4f8c6ba0f765ede to your computer and use it in GitHub Desktop.
Save karesztrk/a2e479d69985a7e9e4f8c6ba0f765ede 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