#include AltSoftSerial HM10; // The library only uses pins 8 and 9, the HM-10 module is automatically configured to using these as corresponding RX and TX pins char c = ' '; boolean NL = true; void setup() { Serial.begin(9600); // Initialize the serial connection to the computer Serial.print("Hello, this code is slightly working!"); // Helping de-bug this code HM10.begin(9600); // Initialize the serial connection to the HM-10 module, note the '9600' due to the HM-10's baud rate. delay(1000); // Wait for the HM-10 module to boot up HM10.write("AT"); // Send an AT command to the HM-10 module to test the connection delay(1000); // Wait for the module to respond while (HM10.available()) { Serial.write(HM10.read()); } } void loop() { if (HM10.available()){ //Reads from the Bluetooth module, writes to Serial Monitor c = HM10.read(); Serial.write(c); } if (Serial.available()){ //Reads from the Serial Monitor, writes to the Bluetooth module c = Serial.read(); if (c!=10 & c!=13){ //Prevents sending line end characters to the HM-10 HM10.write(c); } if (NL) { Serial.print("\r\n>"); NL = false; } Serial.write(c); if (c==10) { NL = true; } } }