Professional Documents
Culture Documents
page_id=43&lang=en
Bluetooth modules normally come factory set to operate at a speed of 38400 bps, whereas s2a_fm
requires that the module operates at 57600 bps.
All bluetooth modules come pre-configured with the same name from the factory.
You will need to give a different name to each of them to use them together in one classroom.
1 of 6 11/25/2018, 4:32 PM
Configuring your Bluetooth Module for the Communication between Scr... http://www.computacaonaescola.ufsc.br/?page_id=43&lang=en
/*==========================================================================================
C O M P U T A Ç Ã O N A E S C O L A
Universidade Federal de Santa Catarina
--- Support Software for the Instructor ---
Configuration sketch for the wireless operation with Scratch via s2a_fm from Bluetooth modules
HC-05 and others that use Hayes commands ending with com CR+LF.
Hayes Commands or AT-commands are a modem configuration language originally developed in 1981
2 of 6 11/25/2018, 4:32 PM
Configuring your Bluetooth Module for the Communication between Scr... http://www.computacaonaescola.ufsc.br/?page_id=43&lang=en
for the Hayes Smartmodem with 300 bps of the now defunct Hayes Microcomputer Products.
Every Hayes command is comprised of "AT" (meaning "attention!") a connector "+" and a keyword followed
or not by parameters.
You can find more information here: http://en.wikipedia.org/wiki/Hayes_command_set
INSTRUCIONS:
How to start:
1. Connect the Arduino to the protoboard or to the HC-05 as shown in the diagram.
2. Connect the Arduino to the USB port of your computer.
3. Open the serial monitor, configuring its speed to 9600 baud and the end of line to NL and CR.
4. Follow the instructions as they appear on the serial monitor, entering the parameters in the input box in the u
Based on the code "HC-05-Modify The HC-05 Bluetooth Module Defaults Using AT Commands" by:
AUTHOR: Hazim Bitar (techbitar)
DATE: Aug 29, 2013
LICENSE: Public domain (use at your own risk)
CONTACT: techbitar at gmail dot com (techbitar.com)
available at: http://www.instructables.com/id/Modify-The-HC-05-Bluetooth-Module-Defaults-Using-A/?ALLSTEPS
==========================================================================================*/
#include <SoftwareSerial.h>
void setup()
3 of 6 11/25/2018, 4:32 PM
Configuring your Bluetooth Module for the Communication between Scr... http://www.computacaonaescola.ufsc.br/?page_id=43&lang=en
{
pinMode(13, OUTPUT); // Let's use an onboard LED as communication activity indicator
pinMode(9, OUTPUT); // Pin to activate the configuration mode (KEY pin of the module)
digitalWrite(9, HIGH); // Activate configuration mode in order to accept Hayes commands
Serial.begin(38400);
BTSerial.begin(38400); // HC-05 default speed in AT command more
delay(1000);
Serial.println("Enter Hayes commands:");
}
void loop()
{
// Read the output of the HC-05 and send to the serial monitor of the Arduino
if (BTSerial.available()){
digitalWrite(13, HIGH);
Serial.write(BTSerial.read());
digitalWrite(13, LOW);
}
// Read what was typed on the serial monitor of the Arduino and send to the HC-05
if (Serial.available()){
digitalWrite(13, HIGH);
BTSerial.write(Serial.read());
digitalWrite(13, LOW);
}
}
AT+UART=57600,0,0
4 of 6 11/25/2018, 4:32 PM
Configuring your Bluetooth Module for the Communication between Scr... http://www.computacaonaescola.ufsc.br/?page_id=43&lang=en
AT+NAME=ARDUINO**
5 of 6 11/25/2018, 4:32 PM
Configuring your Bluetooth Module for the Communication between Scr... http://www.computacaonaescola.ufsc.br/?page_id=43&lang=en
6 of 6 11/25/2018, 4:32 PM