Page tree
Skip to end of metadata
Go to start of metadata

This is a short Arduino routine for configuring the bluetooth module - connected to the Arduino - over Serial Monitor.

// HC-06_Configuration.ino
String command = "";
void setup() {
	Serial.begin(9600);
	Serial1.begin(57600);
	Serial.println("Type AT commands!");
}
void loop() {
	if (Serial1.available() > 0) {
    	while(Serial1.available() > 0) {
      		command += (char)Serial1.read();
    	}
    
    	Serial.println(command);
    	command = "";
  }
  
  if (Serial.available() > 0){
    delay(10); // The delay is necessary to get this working!
    Serial1.write(Serial.read());
  }
}
  • No labels