Development v12

Warning - Product Update

All the resources present on this section belong to Waspmote v12, Waspmote Plug & Sense! v12 and Meshlium v3.8.

If you have a Waspmote v15, Waspmote Plug & Sense! v15 or Meshlium v4.0 please go to the new Development Section.

Check what is your version and what are the differences between the old and the new one in this document.

» 900 06a: Expansion board TX

This example shows how to use two XBee modules simultaneously in Waspmote using the Expansion board. Two different objects are created in this code, each one is used for each module. One is connected in the standard socket (SOCKET0) and the other one is connected to the Expansion board (SOCKET1)

Required Materials

1 x Waspmote PRO
1 x Battery
1 x MiniUSB wire
2 x XBee-900 (two emitters)
1 x Expansion Radio Board


* This example belongs to a two-code example. This is the sending part.
* All XBee modules must be configured with the same network parameters (PANID, channel and encryption mode)


 *  ------   [900_06a] - Use of Expansion board     -------- 
 *  Explanation: This example shows how to use the XBee 900
 *  which is connected to the Expansion board (SOCKET1)
 *  Copyright (C) 2015 Libelium Comunicaciones Distribuidas S.L. 
 *  This program is free software: you can redistribute it and/or modify 
 *  it under the terms of the GNU General Public License as published by 
 *  the Free Software Foundation, either version 3 of the License, or 
 *  (at your option) any later version. 
 *  This program is distributed in the hope that it will be useful, 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  GNU General Public License for more details. 
 *  You should have received a copy of the GNU General Public License 
 *  along with this program.  If not, see <>. 
 *  Version:           0.2
 *  Design:            David Gascón 
 *  Implementation:    Yuri Carmona

#include <WaspXBee900.h>

// Destination MAC address
char RX_ADDRESS[] = "0013A2004066EF95";

// create data fields for each packet
char data[] = "this_is_a_message";

// define variable
uint8_t error;

void setup()
  // Init USB port
  USB.println(F("Send messages via Expansion Board"));

  // 1. init XBees
  // 1.2. initiliaze object in SOCKET1
  xbee900.ON( SOCKET1 );  


void loop()
  // 2. send packet via SOCKET1 

  // send XBee packet
  error = xbee900.send( RX_ADDRESS, data );   
  // check TX flag
  if( error == 0 )
    USB.println(F("send ok"));
    // blink green LED
    USB.println(F("send error"));
    // blink red LED
  // wait for five seconds



Send messages via Expansion Board
send ok
send ok
send ok

Quick Publish: