by bengchet » Tue Mar 22, 2016 5:47 pm
Hi,
Looks like your understanding about hardware is not very firm. Try to understand the role of each hardware before proceed to your main research. It will help you to manipulate this tool to suit your needs of application.
First understand the role of BlueBee. As Yong Hui said, once 2 bluebees are connected, they establish wireless serial link. Remember that, they don't care what kind of data is going between these links, their concern is only one: transmit whatever data the host have dumped to them to the another host ;or receive data from the another host and pass them to own host.
Ok then who are these hosts? That will be your Arduino. Arduino is the one who decides which data is required to send, and also what kind of actions needed to take after received incoming data. For this case, 2 Arduino will be using UART protocols for data transmission between each other because Bluebee supports it. Serial and softwareSerial library provides Arduino ability to send or receive data using UART. Only difference is, serial requires pin 0 as receive pin (RX) and 1 as transmit pin (TX) , softwareSerial can use pins other than 0 and 1 for RX and TX. Let's say Arduino wants to send "Hello world" with pin 3 as TX, we use SoftwareSerial to do so like ...bluebee.print("Hello world").
What if there is no BlueBee as wireless medium? Then 2 Arduinos will be needing wiring in order to communicate with each other. With BlueBee, wireless serial link is established, then 2 Arduino can 'talk' to each other wirelessly.
From previous discussion, I assume you are using XBee shield as well in your research. Think XBee shield as easy interface between Arduino and BlueBee, or should I say, it is acting more like a channel. Let's say we put jumpers at D2(RX) and D3(TX), you are telling BlueBee that Arduino will be sending data(transmit) using pin 3 and receiving data using pin 2. So BlueBee's job is to fetch data from pin 3 before transmit to another host. When receiving data from another host , Bluebee will channel every data to its own host through pin 2 and Arduino gets the data. Of course in program, you should declare SoftwareSerial(2,3) to tell Arduino to transmit data using pin 3 and receiving data from pin 2.
BlueBee library you are using in fact is serial and softwareSerial library. If you understand serial or softwareSerial library, you can use serial or softwareSerial library only to achieve the same purpose. From the link provided, he uses Serial. If you can understand the concept, you will understand why he is using Serial. You can check on how he setup jumpers on Xbee Shield.
Another thing you must understand how Serial library related to Arduino Serial monitor. Pin 0 and 1 of Arduino in fact are hardware RX and TX pins (built-in pins designed for UART purpose) and they are connected to PC once you have attached USB cable from Arduino to PC. Therefore everything Arduino transmit using serial, they will be received by PC and shown in Serial monitor. I hope now you have understood that, your application requires 2 separate UART communication that Arduino must make, one is for PC and another one is for transmitting or receiving data from another Arduino via BlueBee.
Hope you can understand.