Below we included some sample code that can be applied best in use with our boards such as the Autonomo, Mbili or the Tatu. With this sketch you are able to create string of data from the temperature, humidity and pressure sensors on the board.

#include <Wire.h>
#include <Sodaq_BMP085.h>
#include <Sodaq_SHT2x.h>

// MBili / Tatu
//#define debugSerial Serial
// Autonomo
#define debugSerial SerialUSB
//TPH BMP sensor
Sodaq_BMP085 bmp;
void setup() {
  // put your setup code here, to run once:
void loop() {
  // put your main code here, to run repeatedly:
  debugSerial.println("Sending payload: TempSHT21T, TempBMP, PressureBMP, HumiditySHT21T");
  String reading = takeTPHReading();
void setupTPH()
  //Initialize the wire protocol for the TPH sensors

  //Initialize the TPH BMP sensor
String takeTPHReading()
  //Create a String type data record in csv format
  //TempSHT21, TempBMP, PressureBMP, HumiditySHT21
  String data = String(SHT2x.GetTemperature())  + ", ";
  //BMPTemp is commented out, the data will be to long if you also send batt volt.
  data += String(bmp.readTemperature()) + ", ";
  data += String(bmp.readPressure() / 100)  + ", ";
  data += String(SHT2x.GetHumidity());

  return data;