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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

This is a short Arduino routine for configuring the bluetooth module 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