Example Code for Arduino-Bee1 Software Serial & Bee2 Hardware Serial
Last revision 2026/01/12
This article offers a comprehensive guide to setting up Arduino with Bee1 software serial and Bee2 hardware serial ports. It includes hardware requirements, software setup, a wiring diagram, and sample code to demonstrate the functionality of the Bees shield.
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 software serial port, and Bee2 working with the hardware 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 Bee1 device)
software TX is digital pin 3 (connect to RX of Bee1 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 Bee2 hardware!");
mySerial.println("this is Bee1 software!");
delay(500);
}
Result
The app shows the result of Bee1.

The app shows the result of Bee2.

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