Example Code for Arduino-Bee1 Hardware Serial & Bee2 Software Serial
Last revision 2026/01/12
The article presents a comprehensive guide on utilizing Arduino-Bee1 with hardware serial and Bee2 with software serial ports, offering detailed instructions, wiring diagrams, and sample code to ensure effective communication between the devices.
Hardware Preparation
- UNO x1
- Bees Shield x1 (SKU: DFR0210)
- BLE LINK x2 (SKU: 1073, Purchase Link)
- Android or iOS device x1
Software Preparation
- Arduino IDE V1.6.5 Click to Download Arduino IDE from Arduino®
- Install the APK file into your Android phone
- Compile the source code into your Apple device
Wiring Diagram
If you need Bee1 working with the hardware serial port, and Bee2 working with the software serial port, you can change the jumpers and switches like so:

Other Preparation Work
Programmable Switch:
Set the switch to "PROG" when you upload a program
Set the switch to "RUN", when you use the hardware serial port
xBee TX & RX: The silk-screen shows the xBee RX & TX pins, which connect to the Arduino TX & RX ones. It means if you define D2 as Arduino_RX in the code, you should connect to D2 to xBee_TX on the shield. The same goes for Arduino_TX.
Sample Code
/*
# This sample code is used to test the Bees shield.
# Editor : Mickey
# Ver : 1.0
# Product: Bees shield
# SKU : DFR0210
# The circuit:
software RX is digital pin 2 (connect to TX of Bee2 device)
software TX is digital pin 3 (connect to RX of Bee2 device)
*/
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // UNO RX -- Bee TX, UNO TX -- Bee RX
void setup()
{
Serial.begin(115200);
mySerial.begin(115200);
delay(50);
}
void loop()
{
Serial.println("this is Bee1 hardware!");
mySerial.println("this is Bee2 software!");
delay(500);
}
Result
The app shows the result of Bee1.

The app shows the result of Bee2.

Additional Information

Bee1→Hardware Serial Port
Bee2 → Software Serial Port
Was this article helpful?
