

Add to Cart
Arduino Bluetooth expansion board Stackable Bluetooth Shield
Arduino Bluetooth board will extend directly into the main control
board in the Arduino, Arduino Bluetooth communication capabilities
can be extended.Meanwhile, the expansion board is stackable and can
be stacked on this basis, the other expansion board (such as
Ethernet expansion board, rocker panel extensions, extended key
board, etc.), to achieve more.
The Bluetooth module also have the master and slave functions,
according to user needs through the AT command set free, from the
default mode, baud rate 38400, matching 1234, data through the
serial port and the main development board to pass traffic.
As the Arduino UNO only one hardware serial port, serial port when
you want to use to fight back debugging information to a PC serial
port at the same time control the Bluetooth module with time will
be in trouble. This extension a good solution to this problem, you
can choose any of D0 ~ D7 pins connected to the module, the
software provided with our library you can use the hardware serial
port other than the IO control module, the hardware serial port can
be used to communication with a PC, back to playing debugging
information. On-board DIP switch used to manually control the
module level, for access to AT mode. Jumper option module is
connected to the control pin IO pin with software control or toggle
switch used to connect to hardware control.
Examples:
This module has three serial communication link means and the
Arduino board,
The first: direct serial link mode, and remove the Arduino board
master IC, DIN to RX_H (D0), DOUT to TX_H (D1), the hardware serial
transfer. Figure:
The second: indirect way serial link, and tell the complete AT
command code burned into the master, the data read by the master to
write to the Bluetooth module, the link method is DIN to TX_H (D1),
DOUT to RX_H (D0) but the second method will take the serial
Arduino itself, resulting from the Monitor can not monitor the
debug print information, ask your code complete and correct.
Generally not recommended. Figure:
The third: Software serial link approach, this method is the most
flexible, using the software provided by the official Arduino
serial library, we can specify any two IO for the TX and RX.
Software serial port and Bluetooth module through interaction, we
can also monitor the hardware serial port Monitor tool promised
information, set the Bluetooth module via the serial port hardware
and so on. Remove the D0, D1, D2-D7 you have the IO software can be
freely set to serial port. Here we use the D2, D3. Figure:
Test instance:
We use a third way to connect as shown in Figure
/*********************************************************************
** Description: **
** This file is a sample code for your reference. **
** **
** Copyright (C) 2011 ElecFreaks Corp. **
** Created by ElecFreaks Robi.W /29 Sep 2011 **
** **
*********************************************************************/
#include <NewSoftSerial.h>
#include <TimerOne.h>
#define rxPin 2
#define txPin 3
NewSoftSerial mySerial(rxPin, txPin);
void Callback()
{
Serial.println("-------> Callback Send AT");
mySerial.print("ATrn");
}
void setup()
{
// define pin modes for tx, rx pins:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
mySerial.begin(38400);
Serial.begin(38400);
//Timer1.initialize(2000000); // setting callback is 2s
//Timer1.attachInterrupt(Callback);
}
void loop()
{
int i = 0;
char someChar[32] = {0};
// when characters arrive over the serial port...
if(Serial.available()) {
do{
someChar[i++] = Serial.read();
//As data trickles in from your serial port you are grabbing as
much as you can,
//but then when it runs out (as it will after a few bytes because
the processor
//is much faster than a 9600 baud device) you exit loop, which then
restarts,
//and resets i to zero, and someChar to an empty array.So please be
sure to keep this delay
delay(3);
}while (Serial.available() > 0);
mySerial.println(someChar);
Serial.println(someChar);
}
while(mySerial.available())
Serial.print((char)mySerial.read());
}