+ All Categories
Home > Documents > BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled...

BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled...

Date post: 27-Aug-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
48
BlueEva+Sxx Arduino Starter Guide 80512NT11740A Rev. 1 2019-04-16
Transcript
Page 1: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

BlueEva+Sxx Arduino Starter Guide

80512NT11740A Rev. 1 – 2019-04-16

Page 2: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

SPECIFICATIONS ARE SUBJECT TO CHANGE WITHOUT NOTICE

NOTICE

While reasonable efforts have been made to assure the accuracy of this document, Telit assumes no liability resulting from any inaccuracies or omissions in this document, or from use of the information obtained herein. The information in this document has been carefully checked and is believed to be reliable. However, no responsibility is assumed for inaccuracies or omissions. Telit reserves the right to make changes to any products described herein and reserves the right to revise this document and to make changes from time to time in content hereof with no obligation to notify any person of revisions or changes. Telit does not assume any liability arising out of the application or use of any product, software, or circuit described herein; neither does it convey license under its patent rights or the rights of others.

It is possible that this publication may contain references to, or information about Telit products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that Telit intends to announce such Telit products, programming, or services in your country.

COPYRIGHTS

This instruction manual and the Telit products described in this instruction manual may be, include or describe copyrighted Telit material, such as computer programs stored in semiconductor memories or other media. Laws in the Italy and other countries preserve for Telit and its licensors certain exclusive rights for copyrighted material, including the exclusive right to copy, reproduce in any form, distribute and make derivative works of the copyrighted material. Accordingly, any copyrighted material of Telit and its licensors contained herein or in the Telit products described in this instruction manual may not be copied, reproduced, distributed, merged or modified in any manner without the express written permission of Telit. Furthermore, the purchase of Telit products shall not be deemed to grant either directly or by implication, estoppel, or otherwise, any license under the copyrights, patents or patent applications of Telit, as arises by operation of law in the sale of a product.

COMPUTER SOFTWARE COPYRIGHTS

The Telit and 3rd Party supplied Software (SW) products described in this instruction manual may include copyrighted Telit and other 3rd Party supplied computer programs stored in semiconductor memories or other media. Laws in the Italy and other countries preserve for Telit and other 3rd Party supplied SW certain exclusive rights for copyrighted computer programs, including the exclusive right to copy or reproduce in any form the copyrighted computer program. Accordingly, any copyrighted Telit or other 3rd Party supplied SW computer programs contained in the Telit products described in this instruction manual may not be copied (reverse engineered) or reproduced in any manner without the express written permission of Telit or the 3rd Party SW supplier. Furthermore, the purchase of Telit products shall not be deemed to grant either directly or by implication, estoppel, or otherwise, any license under the copyrights, patents or patent applications of Telit or other 3rd Party supplied SW, except for the normal non-exclusive, royalty free license to use that arises by operation of law in the sale of a product.

Page 3: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

USAGE AND DISCLOSURE RESTRICTIONS

I. License Agreements

The software described in this document is the property of Telit and its licensors. It is furnished by express license agreement only and may be used only in accordance with the terms of such an agreement.

II. Copyrighted Materials

Software and documentation are copyrighted materials. Making unauthorized copies is prohibited by law. No part of the software or documentation may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any form or by any means, without prior written permission of Telit

III. High Risk Materials

Components, units, or third-party products used in the product described herein are NOT fault-tolerant and are NOT designed, manufactured, or intended for use as on-line control equipment in the following hazardous environments requiring fail-safe controls: the operation of Nuclear Facilities, Aircraft Navigation or Aircraft Communication Systems, Air Traffic Control, Life Support, or Weapons Systems (High Risk Activities"). Telit and its supplier(s) specifically disclaim any expressed or implied warranty of fitness for such High Risk Activities.

IV. Trademarks

TELIT and the Stylized T Logo are registered in Trademark Office. All other product or service names are the property of their respective owners.

V. Third Party Rights

The software may include Third Party Right software. In this case you agree to comply with all terms and conditions imposed on you in respect of such separate software. In addition to Third Party Terms, the disclaimer of warranty and limitation of liability provisions in this License shall apply to the Third Party Right software.

TELIT HEREBY DISCLAIMS ANY AND ALL WARRANTIES EXPRESS OR IMPLIED FROM ANY THIRD PARTIES REGARDING ANY SEPARATE FILES, ANY THIRD PARTY MATERIALS INCLUDED IN THE SOFTWARE, ANY THIRD PARTY MATERIALS FROM WHICH THE SOFTWARE IS DERIVED (COLLECTIVELY “OTHER CODE”), AND THE USE OF ANY OR ALL THE OTHER CODE IN CONNECTION WITH THE SOFTWARE, INCLUDING (WITHOUT LIMITATION) ANY WARRANTIES OF SATISFACTORY QUALITY OR FITNESS FOR A PARTICULAR PURPOSE.

NO THIRD PARTY LICENSORS OF OTHER CODE SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND WHETHER MADE UNDER CONTRACT, TORT OR OTHER LEGAL THEORY, ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE OTHER CODE OR THE EXERCISE OF ANY RIGHTS GRANTED UNDER EITHER OR BOTH THIS LICENSE AND THE LEGAL TERMS APPLICABLE TO ANY SEPARATE FILES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Page 4: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

APPLICABILITY TABLE

PRODUCTS

BLUEEVA+S50+AS

BLUEEVA+S42/CEN+AS

BLUEEVA+S42/TWI+AS

BLUEEVA+S42M/3ATH+AS

BLUEEVA+S42M+AS

Page 5: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

CONTENTS

NOTICE ................................................................................................................................. 1

COPYRIGHTS ....................................................................................................................... 1

COMPUTER SOFTWARE COPYRIGHTS ............................................................................. 1

USAGE AND DISCLOSURE RESTRICTIONS ...................................................................... 2

APPLICABILITY TABLE ....................................................................................................... 3

CONTENTS ........................................................................................................................... 4

1. INTRODUCTION .......................................................................................................... 7

1.1. Scope ........................................................................................................................... 7

1.2. Contact Information, Support ........................................................................................ 7

1.3. Text Conventions .......................................................................................................... 8

1.4. Related Documents ...................................................................................................... 9

2. GENERALS ................................................................................................................ 10

3. ENVIRONMENT SETUP ............................................................................................ 11

4. ARDUINO® LIBRARIES INSTALLATION ................................................................. 12

Telit library installation ................................................................................................ 12

Accelerometer Gyroscope 3D and pressure sensors library installation ...................... 13

5. TELIT SENSOR LIBRARIES DOCUMENTATION ..................................................... 15

Telit_MAX44009_library - Light sensor (MAX44009)................................................... 15

5.1.1. Class constructor ............................................................................................... 16

5.1.2. Class methods ................................................................................................... 16

5.1.2.1. begin() – Sensor initialization ............................................................................. 16

5.1.2.2. resetDefault() – Reset default values ................................................................. 16

5.1.2.3. setContinuousMeasure () – Set continuous measure ......................................... 17

5.1.2.4. setManualConfiguration() – Set manual measure .............................................. 17

5.1.2.5. setCurrentDivision() – Set internal current division ............................................. 18

5.1.2.6. setIntegrationTime() – Set integration time ........................................................ 18

5.1.2.7. getIntegrationTimeValue() – Get integration time ............................................... 19

5.1.2.8. getLux() – Get current lux value ......................................................................... 19

5.1.2.9. setInterrupt() – Set interrupt functionality ........................................................... 19

5.1.2.10. setUpperThreshold() – Set upper lux threshold .................................................. 20

5.1.2.11. getUpperThresholdValue() – Get current upper lux threshold value ................... 21

5.1.2.12. setLowerThreshold() – Set upper lux threshold .................................................. 21

5.1.2.13. getLowerThresholdValue() – Get current lower lux threshold value ................... 23

Page 6: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5.1.2.14. setThresholdTimer() – Set threshold timer ......................................................... 23

5.1.2.15. isInterrupt() – Check interrupt ............................................................................ 23

5.1.2.16. whichValueZone() – Exceeded threshold zone .................................................. 23

5.1.2.17. resetInterrupt() – Reset interrupt ........................................................................ 24

Telit_HDC2010_library – Temperature and humidity sensor (HDC2010) .................... 24

5.2.1. Class constructor ............................................................................................... 25

5.2.2. Class methods ................................................................................................... 25

5.2.2.1. begin() – Sensor initialization ............................................................................. 25

5.2.2.2. resetDefault() – Reset default values ................................................................. 25

5.2.2.3. getDeviceID() – Get device ID ........................................................................... 26

5.2.2.4. getManufacturerID() – Get manufacturer ID ....................................................... 26

5.2.2.5. setMode() – Set sensor mode ............................................................................ 26

5.2.2.6. setMeasurementRate() – Set measurement rate ............................................... 26

5.2.2.7. setMeasurementType() – Set measurement type .............................................. 27

5.2.2.8. setTemperatureResolution() – Set temperature resolution ................................. 27

5.2.2.9. setHumidityResolution() – Set humidity resolution ............................................. 28

5.2.2.10. setTemperatureOffset() – Set temperature offset ............................................... 28

5.2.2.11. setHumidityOffset() – Set humidity offset ........................................................... 30

5.2.2.12. requestMeasure() – Request measure ............................................................... 31

5.2.2.13. isMeasureAvailable() – Check measure data availability .................................... 32

5.2.2.14. getTemperature() – Get temperature ................................................................. 32

5.2.2.15. getHumidity() – Get humidity.............................................................................. 33

5.2.2.16. getMaxTemperature() – Get max temperature ................................................... 33

5.2.2.17. getMaxHumidity() – Get max humidity ............................................................... 33

5.2.2.18. setHeater() – Reset default values ..................................................................... 34

5.2.2.19. setInterruptPin() – Interrupt pin enable ............................................................... 34

5.2.2.20. setDataReadyInterrupt() – Set data ready interrupt ............................................ 34

5.2.2.21. setInterruptType() – Set interrupt type ............................................................... 35

5.2.2.22. setInterruptMode() – Interrupt mode .................................................................. 36

5.2.2.23. setInterruptPolarity() – Interrupt polarity ............................................................. 36

5.2.2.24. getInterruptStatus() – Get interrupt status .......................................................... 36

5.2.2.25. setTemperatureThresHigh() – Set temperature threshold high .......................... 37

5.2.2.26. setTemperatureThresLow() – Set temperature threshold low ............................. 38

5.2.2.27. setHumidityThresHigh() – Set humidity threshold high ....................................... 39

5.2.2.28. setHumidityThresLow() – Set humidity threshold low ......................................... 40

6. BLUEEVA+SXX EXAMPLES ..................................................................................... 41

Arduino® sketches upload .......................................................................................... 41

Libraries examples ...................................................................................................... 43

6.2.1. Telit_MAX44009_library - Light sensor (MAX44009) ......................................... 43

Page 7: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

6.2.1.1. Luxmeter............................................................................................................ 43

6.2.1.2. LuxmeterInterrupt .............................................................................................. 43

6.2.1.3. LuxmeterInterruptHardware ............................................................................... 43

6.2.2. Telit_HDC2010_library - Humidity & Temperature sensor (HDC2010) ............... 43

6.2.2.1. TempHumidity ................................................................................................... 43

6.2.2.2. TempHumidityAutoMeasure............................................................................... 44

6.2.2.3. TempHumidityInterrupt ...................................................................................... 44

Package examples ..................................................................................................... 44

6.3.1. BLE serial communication ................................................................................. 44

6.3.2. I2C scanner ....................................................................................................... 45

6.3.3. Accelerometer and gyroscope 3D ...................................................................... 46

6.3.4. Pressure and temperature ................................................................................. 46

Page 8: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

1. INTRODUCTION

The information presented in this document is believed to be accurate and reliable. However, no responsibility is assumed by Telit Communications S.p.A. for its use, nor any infringement of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under any patent rights of Telit Communications S.p.A. other than for circuitry embodied in Telit products. This document is subject to change without notice.

1.1. Scope

Scope of this document is provide a bootstrap about Telit BlueEva Arduino® EVK.

1.2. Contact Information, Support

For general contact, technical support services, technical questions and report documentation errors contact Telit Technical Support at:

[email protected]

[email protected]

[email protected]

[email protected]

Alternatively, use:

http://www.telit.com/support

For detailed information about where you can buy the Telit modules or for recommendations

on accessories and components visit:

http://www.telit.com

Our aim is to make this guide as helpful as possible. Keep us informed of your comments and

suggestions for improvements.

Telit appreciates feedback from the users of our information.

Page 9: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

1.3. Text Conventions

Danger – This information MUST be followed or catastrophic equipment

failure or bodily injury may occur.

Caution or Warning – Alerts the user to important points about integrating

the module, if these points are not followed, the module and end user

equipment may fail or malfunction.

Tip or Information – Provides advice and suggestions that may be useful

when integrating the module.

All dates are in ISO 8601 format, i.e. YYYY-MM-DD.

Page 10: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

1.4. Related Documents

The following is a list of applicable documents downloadable from the Download Zone section of Telit website http://www.telit.com

• [1] BlueDev/Eva+Sxx Evaluation Kit User Guide - 1VV0301581

• [2] BlueMod+S42/Central Software User Guide - 1VV0301318

• [3] BlueMod+S42/Central AT Command Reference - 80512ST10771A

• [4] BlueMod+S50/Central Software User Guide - 1VV0301506

• [5] BlueMod+S50/Central AT Command Reference - 80578ST10890A

• [6] BlueMod+S42M Software User Guide - 1VV0301391 • [7] BlueMod+S42M AT Command Reference- 80527ST10839A

Page 11: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

2. GENERALS

BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board

with aim to have an evaluation interface to be used taking advantage of Bluetooth Low Energy

(BLE) connectivity and several types of MEMS sensors (Temperature & Humidity, Pressure,

Ambient Light, 3D Accelerometer and Gyroscope).

Current document provides a bootstrap to use the Telit board through several examples and

library to be used in Arduino® IDE (https://www.arduino.cc/) that can be found on Telit

Download Zone (https://www.telit.com/support-training/download-zone) in

“BlueEva+Sxx_Arduino_Examples” ZIP file.

Page 12: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

3. ENVIRONMENT SETUP

To start using the BlueEva+Sxx board, it is necessary to set up the Arduino® IDE environment. To do that visit the Arduino® website, download the installation file (https://www.arduino.cc/en/Main/Software) and run it as Administrator to be sure that the setup can have complete access to all folders where to place all platform libraries.

After completing the installation, if you are accustomed with Arduino® platform, you can take practice with it visiting the tutorial built-in examples web page https://www.arduino.cc/en/Tutorial/BuiltInExamples. A typical blinking led test is enough to test if the whole Arduino® IDE setup has been installed properly.

Page 13: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

4. ARDUINO® LIBRARIES INSTALLATION

With aim to help the end user, the downloaded ZIP file contains libraries to control and communicate with the MEMS sensor soldered on BleEva+Sxx board. The figure below shows where the sensors take place.

• Humidity & Temperature sensor (HDC2010, write address = 0x82)

• Light sensor (MAX44009, write address = 0x96)

• Accelerometer Gyroscope 3D sensor (LSM6DS3TR, write address = 0xD6)

• Pressure sensor (LPS25HTR, write address = 0xBA)

The “BlueEva+Sxx_Arduino_Examples” ZIP file contains the libraries to control only the humidity & temperature and light sensors. About the remaining two sensors, the appropriate libraries are available on Arduino® library repository: to install them see chapter 4.2.

Telit library installation

To install Telit libraries sensor, for BlueEva+Sxx board using and humidity & temperature and light sensors controlling, both alternative methods can be followed:

1. copy the content of libraries folder (contained in ZIP file) into Arduino libraries folder (generally located in C:\Program Files (x86)\Arduino)

2. copy the content of libraries folder (contained in ZIP file) into Arduino sketchbook location. To find it, open Arduino® IDE, select File→Preferences.

Page 14: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Generally the location is set as user document folder (C:\Users\...\Documents) but it is possible to set any preferred one.

The Telit libraries are:

• Telit_MAX44009_library: Light sensor (MAX44009)

• Telit_HDC2010_library: Humidity & Temperature sensor (HDC2010) Each library has got one or more built-in examples that can be used and manipulated at will.

Each Telit library methods will be described in chapter 5.

Accelerometer Gyroscope 3D and pressure sensors library installation

The libraries to control the accelerometer gyroscope 3D and pressure sensors are available on Arduino® library repository. To install them open Arduino® IDE and select Sketch→Include Library→Manage libraries … and type in the filter field the library keyword reported below.

Page 15: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

• Accelerometer gyroscope 3D: LSM6DS3

• Pressure: LPS

Pay attention, there are several libraries that manage the same type of sensors. If you don’t find the right library as first result, scroll down the list.

Focusing each library, the install button appears in the bottom right corner: press it to add to Arduino® IDE.

To check if the installation has been completed successfully, under Sketch→Include Library menu are reported all available libraries.

Page 16: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5. TELIT SENSOR LIBRARIES DOCUMENTATION

In this chapter will be explained the methods belonging to each Telit sensor libraries with aim to configure and control each sensor properly.

For every Telit sensor libraries, the Wire Arduino built-in library has to be

initialized. The following header has to be added in corresponding section

and the following instruction has to be inserted in pre-defined setup()

function:

Telit_MAX44009_library - Light sensor (MAX44009)

Telit_MAX44009_library library allows to control the ambient light sensor placed on BlueEva+Sxx board and located as highlighted below

To include the current library, use the following header:

#include <BLEEVK_MAX44009.h>

#include <Wire.h>

void setup() {

// Some of your code

Wire.begin();

// Some of your code

}

Page 17: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

If the library has been installed properly, it is possible to include the library

using the Arduino® IDE throw the menu structure Sketch→Include

Library→Telit MAX44009 library.

5.1.1. Class constructor

The BLEEVK_MAX44009 object has to be defined after header section.

Constructors Description

BLEEVK_MAX44009() A BLEEVK_MAX44009 object is created with default values

5.1.2. Class methods

5.1.2.1. begin() – Sensor initialization

The begin method has to be invoked as first class method and only one time in the sketch: for this

reason it has to be applied in pre-defined Arduino® setup() function.

Method Description

begin() Initializes the object related to MAX44009 sensor with default values

begin(reset) Initializes the object related to MAX44009 sensor with or without the default values depending on the value of reset parameter:

• false: the sensor is not initialized with default values

• true: the sensor is initialized using default values

Type Return values Description

void - No return values

5.1.2.2. resetDefault() – Reset default values

The resetDefault method performs a complete reset of the sensor to default values.

Method Description

resetDefault() Perform a complete reset of the sensor to default values

Type Return values Description

void - No return values

Page 18: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5.1.2.3. setContinuousMeasure () – Set continuous measure

The setContinuousMeasure method sets the sensor to perform the ambient light measurements

continuously (according to integration time - see chapter 5.1.2.6) or not. Continuous mode is independent of the manual configuration mode setting (see chapter 5.1.2.4).

Method Description

setContinuousMeasure() Sets the sensor to perform the ambient light measurements continuously.

setContinuousMeasure(cont) Sets the sensor to perform the ambient light measurements continuously or not depending on cont parameter:

• false: the IC operates in default mode and the lux intensity

measures is executed only once every 800ms regardless of integration time. This mode allows the part to operate at its lowest possible supply current

• true: the IC continuously measures lux intensity. That is, as

soon as one reading is finished, a new one begins. In this mode, the part consumes slightly higher power than in the default mode

Type Return values Description

int 0 The method has been performed properly

-10 The continuous mode has not been performed properly

-11 The default mode has not been performed properly

5.1.2.4. setManualConfiguration() – Set manual measure

The setManualConfiguration method sets the sensor to perform the ambient light

measurements using or not user setting related to integration time and current division ratio (see chapter 5.1.2.5).

Method Description

setManualConfiguration() Sets the sensor to perform the ambient light measurements using user settings regarding integration time and current division ratio.

setManualConfiguration(man) Sets the sensor to perform the ambient light measurements using manual mode or user settings (integration time and current division ratio) based on man parameter value:

• false: the IC operates in default mode. Current divition ratio

and integration time are automatically determined by the internal auto ranging circuitry of the IC

• true: the IC operates in manual mode using user settings

regarding integration time and current division ratio

Type Return values Description

int 0 The method has been performed properly

-10 The manual mode has not been performed properly

-11 The default mode has not been performed properly

Page 19: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5.1.2.5. setCurrentDivision() – Set internal current division

The setCurrentDivision method sets the sensor to perform the ambient light measurements

using or not the internal current division.

Method Description

setCurrentDivision(division) Sets the sensor to perform the ambient light measurements using or not internal current based on division parameter value:

• false: current not divided. All of the photodiode current goes

to the internal ADC

• true: Current divided by 8. Only 1/8 of the photodiode current

goes to the ADC. This mode is used in high-brightness situations

Type Return values Description

int 0 The method has been performed properly

-10 The current division enabling has not been performed properly

-11 The current division disabling has not been performed properly

5.1.2.6. setIntegrationTime() – Set integration time

The setIntegrationTime method sets the signal integration time i.e. the time of sensor exposition

before to perform the current measurement related to ambient brightness.

Method Description

setIntegrationTime(timecode) Sets the integration time of the based on timecode parameter value.

The range of timecode parameter is [0-7] corresponding to the

following amount of time:

• 0: 800ms – This is a preferred mode for boosting low-light

sensitivity

• 1: 400ms

• 2: 200ms

• 3: 100ms – This is a preferred mode for high-brightness

applications

• 4: 50ms – Valid only in manual mode (see chapter 5.1.2.4)

• 5: 25ms – Valid only in manual mode (see chapter 5.1.2.4)

• 6: 12.5ms – Valid only in manual mode (see chapter 5.1.2.4)

• 7: 6.25ms – Valid only in manual mode (see chapter 5.1.2.4)

Type Return values Description

int 0 The method has been performed properly

-10 The timecode is out of range

-11 The integration time setting has not been performed properly

Page 20: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5.1.2.7. getIntegrationTimeValue() – Get integration time

The getIntegrationTimeValue method returns the integration time expressed in microseconds.

Method Description

getIntegrationTimeValue() Gets the integration time stored in the sensor register in terms of microseconds.

getIntegrationTimeValue(timecode) Gets the integration time in terms of microseconds corresponding to timecode parameter value (see timecode values in chapter

5.1.2.6).

Type Return values Description

int_32 value The integration time expressed in microseconds

-10 The integration time has not been set yet into the sensor

-1000 The integration timecode is out of range

5.1.2.8. getLux() – Get current lux value

The getLux method provides the lux value measured by sensor. The higher is the integration time,

the more accurate the measure is.

Method Description

getLux() Gets the lux value measured.

Type Return values Description

float value The lux value.

5.1.2.9. setInterrupt() – Set interrupt functionality

The setInterrupt method enables or disables the interrupt triggering by internal sensor circuitry

that occurs when the ambient brightness is greater or lower than upper or lower configurable threshold.

Method Description

setInterrupt(enable) Enables or disables the interrupt triggering based on enable

parameter value:

• false: disable the interrupt

• true: enable the interrupt

Type Return values Description

int 0 The method has been performed properly

-10 The enable interrupt action has not been performed properly

-11 The disable interrupt action has not been performed properly

Page 21: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5.1.2.10. setUpperThreshold() – Set upper lux threshold

The setUpperThreshold method sets the upper threshold used to trigger the interrupt when the

ambient light increase above it at least for integration time duration. The threshold is taken in account only if interrupt has been enabled (see chapter 5.1.2.9).

Method Description

setUpperThreshold(levelindex) Sets the upper lux threshold according to the following table throw the levelindex parameter.

levelindex Lux value levelindex Lux value levelindex Lux value levelindex Lux value

0 0,675 64 56,880 128 910,080 192 14.561,280

1 1,350 65 57,240 129 915,840 193 14.653,440

2 1,395 66 63,000 130 1.008,000 194 16.128,000

3 2,115 67 67,680 131 1.082,880 195 17.326,080

4 2,700 68 68,400 132 1.094,400 196 17.510,400

5 2,790 69 68,760 133 1.100,160 197 17.602,560

6 2,835 70 74,520 134 1.192,320 198 19.077,120

7 3,555 71 79,920 135 1.278,720 199 20.459,520

8 4,230 72 80,280 136 1.284,480 200 20.551,680

9 4,275 73 86,040 137 1.376,640 201 22.026,240

10 4,995 74 86,400 138 1.382,400 202 22.118,400

11 5,400 75 89,280 139 1.428,480 203 22.855,680

12 5,580 76 90,720 140 1.451,520 204 23.224,320

13 5,670 77 91,440 141 1.463,040 205 23.408,640

14 5,715 78 91,800 142 1.468,800 206 23.500,800

15 6,435 79 102,960 143 1.647,360 207 26.357,760

16 7,110 80 113,760 144 1.820,160 208 29.122,560

17 7,155 81 114,480 145 1.831,680 209 29.306,880

18 7,875 82 126,000 146 2.016,000 210 32.256,000

19 8,460 83 135,360 147 2.165,760 211 34.652,160

20 8,550 84 136,800 148 2.188,800 212 35.020,800

21 8,595 85 137,520 149 2.200,320 213 35.205,120

22 9,315 86 149,040 150 2.384,640 214 38.154,240

23 9,990 87 159,840 151 2.557,440 215 40.919,040

24 10,035 88 160,560 152 2.568,960 216 41.103,360

25 10,755 89 172,080 153 2.753,280 217 44.052,480

26 10,800 90 172,800 154 2.764,800 218 45.711,360

27 11,160 91 178,560 155 2.856,960 219 46.448,640

28 11,340 92 181,440 156 2.903,040 220 46.817,280

29 11,430 93 182,880 157 2.926,080 221 47.001,600

30 11,475 94 183,600 158 2.937,600 222 52.715,520

31 12,870 95 205,920 159 3.294,720 223 58.245,120

32 14,220 96 227,520 160 3.640,320 224 58.613,760

33 14,310 97 228,960 161 3.663,360 225 64.512,000

34 15,750 98 252,000 162 4.032,000 226 69.304,320

35 16,920 99 270,720 163 4.331,520 227 70.041,600

36 17,100 100 273,600 164 4.377,600 228 70.410,240

37 17,190 101 275,040 165 4.400,640 229 76.308,480

38 18,630 102 298,080 166 4.769,280 230 81.838,080

39 19,980 103 319,680 167 5.114,880 231 82.206,720

40 20,070 104 321,120 168 5.137,920 232 88.104,960

Page 22: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

41 21,510 105 344,160 169 5.506,560 233 92.897,280

42 21,600 106 345,600 170 5.529,600 234 93.634,560

43 22,320 107 357,120 171 5.713,920 235 94.003,200

44 22,680 108 362,880 172 5.806,080 236 105.431,040

45 22,860 109 365,760 173 5.852,160 237 116.490,240

46 22,950 110 367,200 174 5.875,200 238 117.227,520

47 25,740 111 411,840 175 6.589,440 239 129.024,000

48 28,440 112 455,040 176 7.280,640 240 140.083,200

49 28,620 113 457,920 177 7.326,720 241 140.820,480

50 31,500 114 504,000 178 8.064,000 242 152.616,960

51 33,840 115 541,440 179 8.663,040 243 163.676,160

52 34,200 116 547,200 180 8.755,200 244 164.413,440

53 34,380 117 550,080 181 8.801,280 245 176.209,920

54 37,260 118 596,160 182 9.538,560 246 187.269,120

55 39,960 119 639,360 183 10.229,760 247 188.006,400

56 40,140 120 642,240 184 10.275,840 248 210.862,080

57 43,020 121 688,320 185 11.013,120 249 234.455,040

58 43,200 122 691,200 186 11.059,200 250 258.048,000

59 44,640 123 714,240 187 11.427,840 251 281.640,960

60 45,360 124 725,760 188 11.612,160 252 305.233,920

61 45,720 125 731,520 189 11.704,320 253 328.826,880

62 45,900 126 734,400 190 11.750,400 254 352.419,840

63 51,480 127 823,680 191 13.178,880 255 376.012,800

Type Return values Description

int 0 The method has been performed properly

-10 The upper lux threshold is lower than lower

5.1.2.11. getUpperThresholdValue() – Get current upper lux threshold value

The getUpperThresholdValue method provides the upper lux threshold value set into the ambient

light sensor.

Method Description

getUpperThresholdValue() Gets the upper lux threshold value set into the IC sensor.

Type Return values Description

float value The lux threshold value

5.1.2.12. setLowerThreshold() – Set upper lux threshold

The setLowerThreshold method sets the lower lux threshold used to trigger the interrupt when

the ambient light decrease below it at least for integration time duration. The threshold is taken in account only if interrupt has been enabled (see chapter 5.1.2.9).

Page 23: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

setLowerThreshold(levelindex) Set the lower lux threshold according to the following table throw the levelindex parameter.

levelindex Lux value levelindex Lux value levelindex Lux value levelindex Lux value

0 0,00 35 63,36 70 1.290,24 105 26.542,08

1 0,72 36 69,12 71 1.382,40 106 29.491,20

2 1,44 37 74,88 72 1.474,56 107 32.440,32

3 2,16 38 80,64 73 1.658,88 108 35.389,44

4 2,88 39 86,40 74 1.843,20 109 38.338,56

5 3,60 40 92,16 75 2.027,52 110 41.287,68

6 4,32 41 103,68 76 2.211,84 111 44.236,80

7 5,04 42 115,20 77 2.396,16 112 47.185,92

8 5,76 43 126,72 78 2.580,48 113 53.084,16

9 6,48 44 138,24 79 2.764,80 114 58.982,40

10 7,20 45 149,76 80 2.949,12 115 64.880,64

11 7,92 46 161,28 81 3.317,76 116 70.778,88

12 8,64 47 172,80 82 3.686,40 117 76.677,12

13 9,36 48 184,32 83 4.055,04 118 82.575,36

14 10,08 49 207,36 84 4.423,68 119 88.473,60

15 10,80 50 230,40 85 4.792,32 120 94.371,84

16 11,52 51 253,44 86 5.160,96 121 106.168,32

17 12,96 52 276,48 87 5.529,60 122 117.964,80

18 14,40 53 299,52 88 5.898,24 123 129.761,28

19 15,84 54 322,56 89 6.635,52 124 141.557,76

20 17,28 55 345,60 90 7.372,80 125 153.354,24

21 18,72 56 368,64 91 8.110,08 126 165.150,72

22 20,16 57 414,72 92 8.847,36 127 176.947,20

23 21,60 58 460,80 93 9.584,64 128 188.743,68

24 23,04 59 506,88 94 10.321,92 129 212.336,64

25 25,92 60 552,96 95 11.059,20 130 235.929,60

26 28,80 61 599,04 96 11.796,48 131 259.522,56

27 31,68 62 645,12 97 13.271,04 132 283.115,52

28 34,56 63 691,20 98 14.745,60 133 306.708,48

29 37,44 64 737,28 99 16.220,16 134 330.301,44

30 40,32 65 829,44 100 17.694,72 135 353.894,40

31 43,20 66 921,60 101 19.169,28

32 46,08 67 1.013,76 102 20.643,84

33 51,84 68 1.105,92 103 22.118,40

34 57,60 69 1.198,08 104 23.592,96

Type Return values Description

int 0 The method has been performed properly

-10 The levelindex parameter is out of range

-11 levelindex below of 32. Using a levelindex below of 32 require an

automatic mode measure IC configuration with aim to adjust the integration time according to ambient light level

-12 The lower lux threshold is greater than the upper

Page 24: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5.1.2.13. getLowerThresholdValue() – Get current lower lux threshold value

The getLowerThresholdValue method provides the lower lux threshold value set into the ambient

light sensor.

Method Description

getLowerThresholdValue() Gets the lower lux threshold value set into the IC sensor.

Type Return values Description

float value The lux threshold value

5.1.2.14. setThresholdTimer() – Set threshold timer

The setThresholdTimer method sets the threshold timer. The threshold timer is the time that the

lux value has to exceed the upper or lower threshold.

Method Description

setThresholdTimer(multiplier) Sets the threshold timer as multiplier of 100ms based on the value of multiplier parameter.

Type Return values Description

int 0 The method has been performed properly

-10 The set threshold timer action has not been performed properly

5.1.2.15. isInterrupt() – Check interrupt

The isInterrupt method checks if an interrupt is occurred analyzing the internal register. When

the current method is invoked, the internal interrupt register and pin are automatically reset. Applying the whichValueZone() method (see chapter 5.1.2.16) it is possible to get the lux value

(by reference) that has triggered the interrupt.

Method Description

isInterrupt() Check the status of interrupt register of sensor IC and reset it (including corresponding pin – see reference [1] PL504).

Type Return values Description

boolean true The interrupt is occurred

false The interrupt is not occurred

5.1.2.16. whichValueZone() – Exceeded threshold zone

The whichValueZone method returns an integer value that identifies the zone (upper/lower/middle)

where the ambient light level is. The parameter luxvalue, optionally passed as reference, is used

Page 25: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

to get the lux value. If the interrupt has been triggered (to check it see chapter 5.1.2.15), luxvalue

parameter assumes the last value that has caused it.

Method Description

whichValueZone() To get the identifier of either upper or lower or middle zone reached by ambient light intensity.

whichValueZone(*luxvalue) To get the identifier of either upper or lower or middle zone reached by ambient light intensity. luxvalue has to be float type.

Type Return values Description

int 0 The lux vale is in the middle zone i.e. between upper and lower thresholds. luxvalue is the current ambient light value

1 The lux vale has exceeded the upper threshold. luxvalue is the

ambient light value that has triggered the interrupt

2 The lux vale has exceeded the lower threshold. luxvalue is the

ambient light value that has triggered the interrupt

5.1.2.17. resetInterrupt() – Reset interrupt

The resetInterrupt method resets the interrupt status of IC.

Type Return values Description

void - No return values

Telit_HDC2010_library – Temperature and humidity sensor (HDC2010)

Telit_HDC2010_library library allows to control the temperature and humidity sensor placed on BlueEva+Sxx board and located as highlighted below

To include the current library, use the following header:

#include <BLEEVK_HDC2010.h>

Page 26: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

If the library has been installed properly, it is possible to include the library

using the Arduino® IDE throw the menu structure Sketch→Include

Library→Telit HDC2010 library.

5.2.1. Class constructor

The BLEEVK_HDC2010 object has to be defined after header section.

Constructors Description

BLEEVK_HDC2010() A BLEEVK_HDC2010 object is created with default values

5.2.2. Class methods

5.2.2.1. begin() – Sensor initialization

The begin method has to be invoked as first class method and only one time in the sketch. For this

reason it has to be applied in pre-defined Arduino® setup() function.

Method Description

begin() Initializes the object related to HDC2010 sensor with default values

begin(reset) Initializes the object related to HDC2010 sensor with or without the default values depending on the value of reset parameter:

• false: the sensor is not initialized with default values

• true: the sensor is initialized using default values

Type Return values Description

void - No return values

5.2.2.2. resetDefault() – Reset default values

The resetDefault method performs a complete reset of the sensor to default values.

Method Description

resetDefault() Initializes the object related to HDC2010 sensor with default values

Type Return values Description

void - No return values

Page 27: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5.2.2.3. getDeviceID() – Get device ID

The getDeviceID method provides the sensor ID.

Method Description

getDeviceID() Gets the device ID of the IC sensor.

Type Return values Description

unsigned int value The IC’s device ID

5.2.2.4. getManufacturerID() – Get manufacturer ID

The getManufacturerID method provides the manufacturer ID of the IC sensor.

Method Description

getManufacturerID() Gets the manufacturer ID of the IC sensor.

Type Return values Description

unsigned int value The IC’s manufacturer ID

5.2.2.5. setMode() – Set sensor mode

The setMode method sets the mode of IC sensor.

Method Description

setMode(mode) Sets the mode of the IC sensor according to mode parameter value:

• 0: the sensor measurement is set as manual, the temperature and

humidity values are available only issuing the requestMeasure method

(see chapter 5.2.2.12)

• 1: the sensor measurement is set as automatic, the temperature and

humidity are get, as default, every two minutes. To change the rate, use the method setMeasurementRate (see chapter 5.2.2.6)

To start the automatic measurement, the requestMeasure method (see chapter

5.2.2.12) has to be invoked (only one time so in the Arduino® setup() function).

Type Return values Description

int 0 The method has been performed properly

-10 The mode parameter is out of range

5.2.2.6. setMeasurementRate() – Set measurement rate

The setMeasurementRate method sets the temperature and humidity measurement rate.

Page 28: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

setMeasurementRate(rate) Sets the temperature and humidity measurement rate according to rate

parameter value:

• 0: the measurement is disabled. To get the temperature and

humidity value, use the requestMeasure method (see chapter

5.2.2.12) followed by getTemperature (see chapter 5.2.2.14) or

getHumidity (see chapter 5.2.2.15) methods

• 1: the IC gets 1 sample every 2 minutes

• 2: the IC gets 1 sample every 1 minute

• 3: the IC gets 1 sample every 10 seconds

• 4: the IC gets 1 sample every 5 seconds

• 5: the IC gets 1 sample every second

• 6: the IC gets 2 samples every second

• 7: the IC gets 5 samples every second

Type Return values Description

int 0 The method has been performed properly

-10 The rate parameter is out of range

5.2.2.7. setMeasurementType() – Set measurement type

The setMeasurementRate method sets the measure type among temperature and/or humidity.

Method Description

setMeasurementType(type) Sets the measure type among temperature and/or humidity according to type parameter value:

• 0: humidity + temperature

• 1: temperature

• 2: humidity

• TH, HT: humidity + temperature

• T: temperature

• H: humidity The type parameter can be an integer or a char array.

In case of char array, the type parameter is case insensitive.

Type Return values Description

int 0 The method has been performed properly

-10 The type parameter is out of range or unexpected

5.2.2.8. setTemperatureResolution() – Set temperature resolution

The setTemperatureResolution method sets the executing temperature measurement

resolution.

Page 29: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

setTemperatureResolution(res) Sets the resolution of temperature measurement according to res

parameter value:

• 0: 14 bit

• 1: 11 bit

• 2: 8 bit

Type Return values Description

int 0 The method has been performed properly

-10 The res parameter is out of range

5.2.2.9. setHumidityResolution() – Set humidity resolution

The setHumidityResolution method sets the executing humidity measurement resolution.

Method Description

setHumidityResolution(res) Sets the resolution of humidity measurement according to res parameter

value:

• 0: 14 bit

• 1: 11 bit

• 2: 8 bit

Type Return values Description

int 0 The method has been performed properly

-10 The res parameter is out of range

5.2.2.10. setTemperatureOffset() – Set temperature offset

The setTemperatureOffset method sets the temperature offset with aim to calibrate the IC.

Method Description

setTemperatureOffset(index) Sets the temperature offset, expressed in degrees, according to the following table throw the index parameter.

index Temp. offset

index Temp. offset

index Temp. offset

index Temp. offset

0 -20,62 64 -10,30 128 0,00 192 10,32

1 -20,46 65 -10,14 129 0,16 193 10,48

2 -20,30 66 -9,98 130 0,32 194 10,64

3 -20,14 67 -9,82 131 0,48 195 10,80

4 -19,98 68 -9,66 132 0,64 196 10,96

5 -19,82 69 -9,50 133 0,80 197 11,12

6 -19,66 70 -9,34 134 0,96 198 11,28

7 -19,50 71 -9,18 135 1,12 199 11,44

8 -19,34 72 -9,02 136 1,28 200 11,60

Page 30: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

9 -19,18 73 -8,86 137 1,44 201 11,76

10 -19,02 74 -8,70 138 1,60 202 11,92

11 -18,86 75 -8,54 139 1,76 203 12,08

12 -18,70 76 -8,38 140 1,92 204 12,24

13 -18,54 77 -8,22 141 2,08 205 12,40

14 -18,38 78 -8,06 142 2,24 206 12,56

15 -18,22 79 -7,90 143 2,40 207 12,72

16 -18,04 80 -7,72 144 2,58 208 12,90

17 -17,88 81 -7,56 145 2,74 209 13,06

18 -17,72 82 -7,40 146 2,90 210 13,22

19 -17,56 83 -7,24 147 3,06 211 13,38

20 -17,40 84 -7,08 148 3,22 212 13,54

21 -17,24 85 -6,92 149 3,38 213 13,70

22 -17,08 86 -6,76 150 3,54 214 13,86

23 -16,92 87 -6,60 151 3,70 215 14,02

24 -16,76 88 -6,44 152 3,86 216 14,18

25 -16,60 89 -6,28 153 4,02 217 14,34

26 -16,44 90 -6,12 154 4,18 218 14,50

27 -16,28 91 -5,96 155 4,34 219 14,66

28 -16,12 92 -5,80 156 4,50 220 14,82

29 -15,96 93 -5,64 157 4,66 221 14,98

30 -15,80 94 -5,48 158 4,82 222 15,14

31 -15,64 95 -5,32 159 4,98 223 15,30

32 -15,46 96 -5,14 160 5,16 224 15,48

33 -15,30 97 -4,98 161 5,32 225 15,64

34 -15,14 98 -4,82 162 5,48 226 15,80

35 -14,98 99 -4,66 163 5,64 227 15,96

36 -14,82 100 -4,50 164 5,80 228 16,12

37 -14,66 101 -4,34 165 5,96 229 16,28

38 -14,50 102 -4,18 166 6,12 230 16,44

39 -14,34 103 -4,02 167 6,28 231 16,60

40 -14,18 104 -3,86 168 6,44 232 16,76

41 -14,02 105 -3,70 169 6,60 233 16,92

42 -13,86 106 -3,54 170 6,76 234 17,08

43 -13,70 107 -3,38 171 6,92 235 17,24

44 -13,54 108 -3,22 172 7,08 236 17,40

45 -13,38 109 -3,06 173 7,24 237 17,56

46 -13,22 110 -2,90 174 7,40 238 17,72

47 -13,06 111 -2,74 175 7,56 239 17,88

48 -12,88 112 -2,56 176 7,74 240 18,06

49 -12,72 113 -2,40 177 7,90 241 18,22

50 -12,56 114 -2,24 178 8,06 242 18,38

51 -12,40 115 -2,08 179 8,22 243 18,54

52 -12,24 116 -1,92 180 8,38 244 18,70

53 -12,08 117 -1,76 181 8,54 245 18,86

54 -11,92 118 -1,60 182 8,70 246 19,02

55 -11,76 119 -1,44 183 8,86 247 19,18

56 -11,60 120 -1,28 184 9,02 248 19,34

57 -11,44 121 -1,12 185 9,18 249 19,50

58 -11,28 122 -0,96 186 9,34 250 19,66

59 -11,12 123 -0,80 187 9,50 251 19,82

60 -10,96 124 -0,64 188 9,66 252 19,98

Page 31: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

61 -10,80 125 -0,48 189 9,82 253 20,14

62 -10,64 126 -0,32 190 9,98 254 20,30

63 -10,48 127 -0,16 191 10,14 255 20,46

Type Return values Description

void - No return values

5.2.2.11. setHumidityOffset() – Set humidity offset

The setHumidityOffset method sets the humidity offset with aim to calibrate the IC.

Method Description

setHumidityOffset(index) Sets the humidity offset, expressed in percentage, according to the following table throw the index parameter.

index Hum. offset index Hum. offset index Hum. offset index Hum. offset

0 -25,0 64 -12,5 128 0,0 192 12,5

1 -24,8 65 -12,3 129 0,2 193 12,7

2 -24,6 66 -12,1 130 0,4 194 12,9

3 -24,4 67 -11,9 131 0,6 195 13,1

4 -24,2 68 -11,7 132 0,8 196 13,3

5 -24,0 69 -11,5 133 1,0 197 13,5

6 -23,8 70 -11,3 134 1,2 198 13,7

7 -23,6 71 -11,1 135 1,4 199 13,9

8 -23,4 72 -10,9 136 1,6 200 14,1

9 -23,2 73 -10,7 137 1,8 201 14,3

10 -23,0 74 -10,5 138 2,0 202 14,5

11 -22,8 75 -10,3 139 2,2 203 14,7

12 -22,6 76 -10,1 140 2,4 204 14,9

13 -22,4 77 -9,9 141 2,6 205 15,1

14 -22,2 78 -9,7 142 2,8 206 15,3

15 -22,0 79 -9,5 143 3,0 207 15,5

16 -21,9 80 -9,4 144 3,1 208 15,6

17 -21,7 81 -9,2 145 3,3 209 15,8

18 -21,5 82 -9,0 146 3,5 210 16,0

19 -21,3 83 -8,8 147 3,7 211 16,2

20 -21,1 84 -8,6 148 3,9 212 16,4

21 -20,9 85 -8,4 149 4,1 213 16,6

22 -20,7 86 -8,2 150 4,3 214 16,8

23 -20,5 87 -8,0 151 4,5 215 17,0

24 -20,3 88 -7,8 152 4,7 216 17,2

25 -20,1 89 -7,6 153 4,9 217 17,4

26 -19,9 90 -7,4 154 5,1 218 17,6

27 -19,7 91 -7,2 155 5,3 219 17,8

28 -19,5 92 -7,0 156 5,5 220 18,0

29 -19,3 93 -6,8 157 5,7 221 18,2

30 -19,1 94 -6,6 158 5,9 222 18,4

31 -18,9 95 -6,4 159 6,1 223 18,6

Page 32: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

32 -18,7 96 -6,2 160 6,3 224 18,8

33 -18,5 97 -6,0 161 6,5 225 19,0

34 -18,3 98 -5,8 162 6,7 226 19,2

35 -18,1 99 -5,6 163 6,9 227 19,4

36 -17,9 100 -5,4 164 7,1 228 19,6

37 -17,7 101 -5,2 165 7,3 229 19,8

38 -17,5 102 -5,0 166 7,5 230 20,0

39 -17,3 103 -4,8 167 7,7 231 20,2

40 -17,1 104 -4,6 168 7,9 232 20,4

41 -16,9 105 -4,4 169 8,1 233 20,6

42 -16,7 106 -4,2 170 8,3 234 20,8

43 -16,5 107 -4,0 171 8,5 235 21,0

44 -16,3 108 -3,8 172 8,7 236 21,2

45 -16,1 109 -3,6 173 8,9 237 21,4

46 -15,9 110 -3,4 174 9,1 238 21,6

47 -15,7 111 -3,2 175 9,3 239 21,8

48 -15,6 112 -3,1 176 9,4 240 21,9

49 -15,4 113 -2,9 177 9,6 241 22,1

50 -15,2 114 -2,7 178 9,8 242 22,3

51 -15,0 115 -2,5 179 10,0 243 22,5

52 -14,8 116 -2,3 180 10,2 244 22,7

53 -14,6 117 -2,1 181 10,4 245 22,9

54 -14,4 118 -1,9 182 10,6 246 23,1

55 -14,2 119 -1,7 183 10,8 247 23,3

56 -14,0 120 -1,5 184 11,0 248 23,5

57 -13,8 121 -1,3 185 11,2 249 23,7

58 -13,6 122 -1,1 186 11,4 250 23,9

59 -13,4 123 -0,9 187 11,6 251 24,1

60 -13,2 124 -0,7 188 11,8 252 24,3

61 -13,0 125 -0,5 189 12,0 253 24,5

62 -12,8 126 -0,3 190 12,2 254 24,7

63 -12,6 127 -0,1 191 12,4 255 24,9

Type Return values Description

void - No return values

5.2.2.12. requestMeasure() – Request measure

The requestMeasure method starts the IC process to get the temperature and/or humidity value

depending on previous setting performed using setMeasurementType method (see chapter

5.2.2.7).

Method Description

requestMeasure() Starts the process to get the temperature and/or humidity value. To check if the measure has been performed and completed, invoke the method isMeasureAvailable (see chapter 5.2.2.13). To get the temperature, use the

method getTemperature (see chapter 5.2.2.14). To get the humidity, use the

method getHumidity (see chapter 5.2.2.15). It is possible to query a new

Page 33: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

sensor measure only after invoking the method isMeasureAvailable (see

chapter 5.2.2.13).

Type Return values Description

int 0 The method has been performed properly and the temperature and/or humidity measurement is started

-10 The method has not been performed properly. Error during IC registry access

-11 The measure type has not been set. See chapter 5.2.2.7

-12 The IC has been set in automatic mode. The method requestMeasure can only be invoked in manual mode (see

chapter 5.2.2.5)

-13 The requestMeasure has been already invoked. Check the data

availability using isMeasureAvailable (see chapter 5.2.2.13)

5.2.2.13. isMeasureAvailable() – Check measure data availability

The isMeasureAvailable method checks if the measure has been performed and temperature

and/or humidity values are available. If a previous measure request has been performed (see chapter 5.2.2.12), it is possible to query a new sensor measure only after the current method invoking.

Method Description

isMeasureAvailable() Check if, after a measure request, the sensor data are available

Type Return values Description

boolean true The sensor data are available

false The sensor data are not available

5.2.2.14. getTemperature() – Get temperature

The getTemperature method provides the temperature sensor value as result of requestMeasure

method invoking.

Method Description

getTemperature() Gets the sensor temperature.

Type Return values Description

float value The temperature value measured

-1000 The temperature value is either not available or measure type is not set as temperature (see chapter 5.2.2.7)

Page 34: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5.2.2.15. getHumidity() – Get humidity

The getHumidity method provides the humidity sensor value as result of requestMeasure method

invoking.

Method Description

getHumidity() Gets the sensor humidity.

Type Return values Description

float value The humidity value measured

-1000 The humidity value is either not available or measure type is not set as humidity (see chapter 5.2.2.7)

5.2.2.16. getMaxTemperature() – Get max temperature

The getMaxTemperature method provides the max temperature measured. This future is available

only in manual measure mode (see chapter 5.2.2.5). The value is reset either at power up or using resetDefault method (see chapter 5.2.2.2) or throw the reset parameter.

Method Description

getMaxTemperature() Gets the max temperature measured and reset the internal IC sensor temperature peak value

getMaxTemperature(reset) Gets the max temperature measured and reset or not the internal IC sensor peak value according to reset parameter:

• true: the internal IC sensor temperature peak value is reset

• false: the internal IC sensor temperature peak value is reset

Type Return values Description

float value The max temperature measured

-1000 The max temperature not detected or measure mode has not been set as manual

5.2.2.17. getMaxHumidity() – Get max humidity

The getMaxHumidity method provides the max humidity measured. This future is available only in

manual measure mode (see chapter 5.2.2.5). The value is reset at power up or using resetDefault method (see chapter 5.2.2.2) or throw the reset parameter.

Method Description

getMaxHumidity() Gets the max humidity measured and reset the internal IC sensor humidity peak value.

getMaxHumidity(reset) Gets the max humidity measured and reset or not the internal IC sensor peak value according to reset parameter:

• true: the internal IC sensor humidity peak value is reset

Page 35: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

false: the internal IC sensor humidity peak value is reset

Type Return values Description

float value The max humidity measured

-1000 The max humidity not detected or measure mode has not been set as manual

5.2.2.18. setHeater() – Reset default values

The setHeater method enable or disable the internal heater to prevent or remove any

condensation that may build up in high humidity environments.

Method Description

setHeater(onoff) Enable or disable the internal IC heater according to onoff parameter:

• true: internal heater enabled

• false: internal heater disabled

Type Return values Description

void - No return values

5.2.2.19. setInterruptPin() – Interrupt pin enable

The setInterruptPin method enable or disable the interrupt pin.

Method Description

setInterruptPin(enable) Enable or disable the IC interrupt pin according to enable parameter:

• true: the IC interrupt pin is enabled, each interrupt events are reflected on corresponding pin (see reference [1] PL504). To set the interrupt polarity, use setInterruptPolarity method (see chapter

5.2.2.23). To set the interrupt mode, use setInterruptMode method

(see chapter 5.2.2.22).To set the interrupt type, use setInterruptType method (see chapter 5.2.2.21).

• false: the IC interrupt pin is disabled and set as high impedance

Type Return values Description

void - No return values

5.2.2.20. setDataReadyInterrupt() – Set data ready interrupt

The setDataReadyInterrupt method enable or disable the interrupt related to temperature and

humidity data availability. The interrupt triggering is reflected on interrupt pin.

Page 36: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

setDataReadyInterrupt(enable) Sets the data ready interrupt according to enable parameter:

• true: the data ready interrupt is enabled

• false: the data ready interrupt is disabled

Type Return values Description

void - No return values

5.2.2.21. setInterruptType() – Set interrupt type

The setInterruptType method enable or disable the interrupt related to temperature and humidity

in case their values are over or under the programmed thresholds. To set the temperature and humidity thresholds use setTemperatureThresHigh (see chapter 5.2.2.25),

setTemperatureThresLow (see chapter 5.2.2.26), setHumidityThresHigh (see chapter

5.2.2.27) and setHumidityThresLow (see chapter 5.2.2.28).

Method Description

setInterruptType(typeindex) Sets the interrupt type according to typeindex parameter. The X char

means that the interrupt is triggered if the condition is satisfied (ex. if the temperature rise over the temperature high threshold)

typeindex Temperature High Temperature Low Humidity High Humidity Low

0 No interrupt triggering

1 X

2 X

3 X X

4 X

5 X X

6 X X

7 X X X

8 X

9 X X

10 X X

11 X X X

12 X X

13 X X X

14 X X X

15 X X X X

When multiple interrupt condition are set (typeindex equal to 3, 5, 6, 7,

9 … 15), the interrupt pin can only reflect the status of one event at time. The pin status does not function as the logical OR of the events that have been enabled. The highest priority is assigned to Temperature High followed by Temperature Low, Humidity High, and Humidity Low in descending order.

Type Return values Description

int 0 The method has been performed properly

-10 The typeindex parameter is out of range

Page 37: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

5.2.2.22. setInterruptMode() – Interrupt mode

The setInterruptMode method sets the threshold to either comparator mode or a level sensitive

alarm. In comparator mode, the interrupt status (temperature/humidity high/low – see chapter 5.2.2.20) remains set until it is read. In level sensitive mode, the interrupt status is based on the current temperature/humidity conversion: only when the value is over the high threshold or under the low threshold the interrupt is triggered.

Method Description

setInterruptMode(mode) Sets the interrupt mode according to mode parameter:

• 0: the IC interrupt is set in level sensitive mode

• 1: the IC interrupt is set in comparator mode

Type Return values Description

int 0 The method has been performed properly

-10 The mode parameter is out of range

5.2.2.23. setInterruptPolarity() – Interrupt polarity

The setInterruptPolarity method sets the polarity of the interrupt pin.

Method Description

setInterruptPolarity(pol) Sets the interrupt pin polarity according to pol parameter:

• 0: the IC interrupt pin is active as low

• 1: the IC interrupt pin is active as high

Type Return values Description

int 0 The method has been performed properly

-10 The pol parameter is out of range

5.2.2.24. getInterruptStatus() – Get interrupt status

The getInterruptStatus method gets the status of the interrupt.

Method Description

getInterruptStatus() Gets the interrupt status about data ready and temperature/humidity related to exceeding of the thresholds (upper and lower). The meaning of the return value is reported below where X character means that the interrupt event is occurred.

Type Return values

Data ready

Temperature High

Temperature Low

Humidity High

Humidity Low

int 0 No interrupt event occurred

1 X

Page 38: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Type Return values

Data ready

Temperature High

Temperature Low

Humidity High

Humidity Low

2 X

3 X X

4 X

5 X X

6 X X

7 X X X

8 X

9 X X

10 X X

11 X X X

12 X X

13 X X X

14 X X X

15 X X X X

16 X

17 X X

18 X X

19 X X X

20 X X

21 X X X

22 X X X

23 X X X X

24 X X

25 X X X

26 X X X

27 X X X X

28 X X X

29 X X X X

30 X X X X

31 X X X X X

5.2.2.25. setTemperatureThresHigh() – Set temperature threshold high

The setTemperatureThresHigh method sets the upper temperature threshold used to trigger the

high temperature interrupt.

Method Description

setTemperatureThresHigh(value) Sets the upper temperature threshold to value parameter. The

value parameter is converted using 8 bit so no all values are

allowed. The method’s return value represents the stored threshold value.

Page 39: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

Possible values of value parameter are:

-40,00 -19,38 1,25 21,88 42,50 63,13 83,75 104,38

-39,36 -18,73 1,89 22,52 43,14 63,77 84,39 105,02

-38,71 -18,09 2,54 23,16 43,79 64,41 85,04 105,66

-38,07 -17,44 3,18 23,81 44,43 65,06 85,68 106,31

-37,42 -16,80 3,83 24,45 45,08 65,70 86,33 106,95

-36,78 -16,15 4,47 25,10 45,72 66,35 86,97 107,60

-36,13 -15,51 5,12 25,74 46,37 66,99 87,62 108,24

-35,49 -14,86 5,76 26,39 47,01 67,64 88,26 108,89

-34,84 -14,22 6,41 27,03 47,66 68,28 88,91 109,53

-34,20 -13,57 7,05 27,68 48,30 68,93 89,55 110,18

-33,55 -12,93 7,70 28,32 48,95 69,57 90,20 110,82

-32,91 -12,29 8,34 28,96 49,59 70,21 90,84 111,46

-32,27 -11,64 8,98 29,61 50,23 70,86 91,48 112,11

-31,62 -11,00 9,63 30,25 50,88 71,50 92,13 112,75

-30,98 -10,35 10,27 30,90 51,52 72,15 92,77 113,40

-30,33 -9,71 10,92 31,54 52,17 72,79 93,42 114,04

-29,69 -9,06 11,56 32,19 52,81 73,44 94,06 114,69

-29,04 -8,42 12,21 32,83 53,46 74,08 94,71 115,33

-28,40 -7,77 12,85 33,48 54,10 74,73 95,35 115,98

-27,75 -7,13 13,50 34,12 54,75 75,37 96,00 116,62

-27,11 -6,48 14,14 34,77 55,39 76,02 96,64 117,27

-26,46 -5,84 14,79 35,41 56,04 76,66 97,29 117,91

-25,82 -5,20 15,43 36,05 56,68 77,30 97,93 118,55

-25,18 -4,55 16,07 36,70 57,32 77,95 98,57 119,20

-24,53 -3,91 16,72 37,34 57,97 78,59 99,22 119,84

-23,89 -3,26 17,36 37,99 58,61 79,24 99,86 120,49

-23,24 -2,62 18,01 38,63 59,26 79,88 100,51 121,13

-22,60 -1,97 18,65 39,28 59,90 80,53 101,15 121,78

-21,95 -1,33 19,30 39,92 60,55 81,17 101,80 122,42

-21,31 -0,68 19,94 40,57 61,19 81,82 102,44 123,07

-20,66 -0,04 20,59 41,21 61,84 82,46 103,09 123,71

-20,02 0,61 21,23 41,86 62,48 83,11 103,73 124,36

All values are second digit rounded and expressed in °C

Type Return values Description

float value The stored threshold value (equal to value parameter converted

using 8 bit)

-1000 The threshold value is out of range (allowed values have to be in the range -40 ÷ 124,36 °C)

5.2.2.26. setTemperatureThresLow() – Set temperature threshold low

The setTemperatureThresLow method sets the lower temperature threshold used to trigger the

low temperature interrupt.

Page 40: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

setTemperatureThresLow(value) Sets the lower temperature threshold to value parameter. The

value parameter is converted using 8 bit so no all values are

allowed. The method’s return value represents the stored threshold value. Possible values of value parameter are the same reported in the

table in the chapter 5.2.2.25.

Type Return values Description

float value The stored threshold value (equal to value parameter converted

using 8 bit)

-1000 The threshold value is out of range (allowed values have to be in the range -40 ÷ 124,36 °C)

5.2.2.27. setHumidityThresHigh() – Set humidity threshold high

The setHumidityThresHigh method sets the upper humidity threshold used to trigger the high

humidity interrupt.

Method Description

setHumidityThresHigh(value) Sets the upper humidity threshold to value parameter. The value

parameter is converted using 8 bit so no all values are allowed. The method’s return value represents the stored threshold value. Possible values of value parameter are:

0,00 12,50 25,00 37,50 50,00 62,50 75,00 87,50

0,39 12,89 25,39 37,89 50,39 62,89 75,39 87,89

0,78 13,28 25,78 38,28 50,78 63,28 75,78 88,28

1,17 13,67 26,17 38,67 51,17 63,67 76,17 88,67

1,56 14,06 26,56 39,06 51,56 64,06 76,56 89,06

1,95 14,45 26,95 39,45 51,95 64,45 76,95 89,45

2,34 14,84 27,34 39,84 52,34 64,84 77,34 89,84

2,73 15,23 27,73 40,23 52,73 65,23 77,73 90,23

3,13 15,63 28,13 40,63 53,13 65,63 78,13 90,63

3,52 16,02 28,52 41,02 53,52 66,02 78,52 91,02

3,91 16,41 28,91 41,41 53,91 66,41 78,91 91,41

4,30 16,80 29,30 41,80 54,30 66,80 79,30 91,80

4,69 17,19 29,69 42,19 54,69 67,19 79,69 92,19

5,08 17,58 30,08 42,58 55,08 67,58 80,08 92,58

5,47 17,97 30,47 42,97 55,47 67,97 80,47 92,97

5,86 18,36 30,86 43,36 55,86 68,36 80,86 93,36

6,25 18,75 31,25 43,75 56,25 68,75 81,25 93,75

6,64 19,14 31,64 44,14 56,64 69,14 81,64 94,14

7,03 19,53 32,03 44,53 57,03 69,53 82,03 94,53

7,42 19,92 32,42 44,92 57,42 69,92 82,42 94,92

7,81 20,31 32,81 45,31 57,81 70,31 82,81 95,31

8,20 20,70 33,20 45,70 58,20 70,70 83,20 95,70

8,59 21,09 33,59 46,09 58,59 71,09 83,59 96,09

Page 41: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Method Description

8,98 21,48 33,98 46,48 58,98 71,48 83,98 96,48

9,38 21,88 34,38 46,88 59,38 71,88 84,38 96,88

9,77 22,27 34,77 47,27 59,77 72,27 84,77 97,27

10,16 22,66 35,16 47,66 60,16 72,66 85,16 97,66

10,55 23,05 35,55 48,05 60,55 73,05 85,55 98,05

10,94 23,44 35,94 48,44 60,94 73,44 85,94 98,44

11,33 23,83 36,33 48,83 61,33 73,83 86,33 98,83

11,72 24,22 36,72 49,22 61,72 74,22 86,72 99,22

12,11 24,61 37,11 49,61 62,11 74,61 87,11 99,61

All values are second digit rounded and expressed in %

Type Return values Description

float value The stored threshold value (equal to value parameter converted

using 8 bit)

-1000 The threshold value is out of range (allowed values have to be in the range 0 ÷ 99,61)

5.2.2.28. setHumidityThresLow() – Set humidity threshold low

The setHumidityThresLow method sets the lower humidity threshold used to trigger the low

humidity interrupt.

Method Description

setHumidityThresLow(value) Sets the lower humidity threshold to value parameter. The value

parameter is converted using 8 bit so no all values are allowed. The method’s return value represents the stored threshold value. Possible values of value parameter are the same reported in the

table in the chapter 5.2.2.27.

Type Return values Description

float value The stored threshold value (equal to value parameter converted

using 8 bit)

-1000 The threshold value is out of range (allowed values have to be in the range 0 ÷ 99,61)

Page 42: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

6. BLUEEVA+SXX EXAMPLES

All examples for BlueEva+Sxx can be found on Telit Download Zone website. To be used, the package needs to be unzipped. The folder structure is organized for examples: each of them has got its own folder. The folder’s naming convention follows the Arduino IDE rule: each folder’s name has to be the same of the *.ino filename contained in it. If the two names don’t match each other, an error will be displayed during file opening.

Following will be introduced some examples (sketches, according with Arduino’s world terminology) to communicate and interact with the BLE module and the sensor soldered on BlueEva+Sxx board.

Arduino® sketches upload

Every following Arduino® sketches can be loaded into Arduino® Uno board in the same way. Before proceeding, assemble the BlueEva+Sxx board to Arduino® using its standard socket and link it with PC using USB cable (Type A - Type B).

To upload the sketch file:

1. Open the sketch file to upload (double click on *.ino file or open Arduino® IDE and select File → Open … followed by *.ino file selection)

2. On navigation bar select Tools → Board: and select the “Arduino/Genuino Uno” board 3. Again under Tools menu, select the proper COM port 4. Under Sketch menu select Upload (Ctrl+U). The upload process starts and it is possible

to see the progress on the status area (the bottom area of the IDE)

Page 43: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

If the sketch is designed to send/receive messages on serial port, it is possible to see them using the serial port monitor. To open it select on navigation bar Tools → Serial monitor (Ctrl+Shift+M).

Page 44: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

The baud rate set in serial monitor has to be the same set in the

sketch otherwise all serial traffic could not appears as expected.

All following examples have to be intended for BlueEva+Sxx in

combination with Arduino® Uno board

Libraries examples

In this chapter are listed and briefly described the Telit libraries built-in examples. To use them it is necessary to install the related libraries (see chapter 4.1).

6.2.1. Telit_MAX44009_library - Light sensor (MAX44009)

6.2.1.1. Luxmeter

With this example the ambient light value (expressed in lux) is printed on serial port. The measure is performed in a time equal to the double of the integration time set using the setIntegrationTime (see chapter 5.1.2.6) so every 200 ms.

6.2.1.2. LuxmeterInterrupt

With this example a continuous ambient light measurement is performed by the IC sensor and only when its value exceeds the upper or lower threshold (see chapters 5.1.2.10 and 5.1.2.12 to set them) the current lux value is printed on serial port. The interrupt is checked via software by IC sensor registry polling.

6.2.1.3. LuxmeterInterruptHardware

With this example a continuous ambient light measurement is performed by the IC sensor and only when its value exceeds the upper or lower threshold (see chapters 5.1.2.10 and 5.1.2.12 to set them) the current lux value is printed on serial port. The interrupt is checked via hardware polling the related interrupt pin status.

6.2.2. Telit_HDC2010_library - Humidity & Temperature sensor (HDC2010)

6.2.2.1. TempHumidity

With this example the temperature and humidity values are printed on serial port when their values are available (see isMeasureAvailable method in chapter 5.2.2.13). The measure

is requested using of requestMeasure method (see chapter 5.2.2.12).

Page 45: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

6.2.2.2. TempHumidityAutoMeasure

With this example the temperature and humidity IC sensor is set to perform in background a continuous measurement and, every a predefined timeout, their values are get and printed on serial port.

6.2.2.3. TempHumidityInterrupt

With this example the temperature and humidity IC sensor is set to perform in background a continuous measurement and, when the values exceed pre-defined thresholds, their values are get and printed on serial port. There is a continuous polling of the related IC sensor interrupt pin.

Package examples

In this chapter are listed and briefly described the examples included in the “BlueEva+Sxx_Arduino_Examples” ZIP file.

6.3.1. BLE serial communication

The only way to communicate with the BLE module placed on BlueEva+Sxx board using Arduino® is through a software serial port creation. The example named “BLE_serial_pt” performs it. Despite the built-in Arduino® Software Serial library documentation (https://www.arduino.cc/en/Reference/SoftwareSerial) declares that the maximum baud rate is 115200, the proper speed to be sure to not lose information in serial communication is 57600. The current sketch simulates the hardware serial communication with the BLE module like using the USB cable (for further information about BlueEva+Sxx USB connection refer to [1] document), establishing a pass-through communication between Arduino® serial port and BLE module.

To upload it refer to chapter 6.1.

Page 46: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

6.3.2. I2C scanner

This sketch is not valid for BlueEva+S42M/3ATH+AS and BlueEva+S42M+AS boards.

The BlueEva+Sxx board is equipped with four MEMS sensor:

• Temperature & Humidity

• Pressure

• Ambient Light

• 3D Accelerometer and Gyroscope

The communication with each sensor is performed using I2C bus. The address of each of them is in 7-bit format. For further information about their PCB location and PN, refer to [1] document.

The I2C scanner example (BlueEva_sensor_scanner) executes a complete search on I2C bus with aim to detect all connected devices. The search starts from lowest address to highest. Each time that a device responds, its address (7-bit) is printed out on Arduino® serial monitor.

To upload it refer to chapter 6.1.

Page 47: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

6.3.3. Accelerometer and gyroscope 3D

The “BlueEva_accelerometer_gyro_3D” example, contained inside the ZIP, allows to get the data from the accelerometer and gyroscope 3D sensor. To use the current Arduino® sketch, it is mandatory have the LSM6DS3 library installed (see chapter 4.2). The example prints on serial port the three axes (X, Y and Z) for both data type. The units of the accelerometer is g (standard gravitational unit). The units of the gyroscope is expressed in dps (degrees per seconds).

For additional info related to the involved LSM6DS3 library, refer to https://github.com/stm32duino/LSM6DS3.

6.3.4. Pressure and temperature

The “BlueEva_ BlueEva_pressure_sensor” example, contained inside the ZIP, allows to get the pressure and temperature coming from the single LPS25HTR IC sensor. To use the current Arduino® sketch, it is mandatory have the LPS25HTR library installed (see chapter 4.2). The example prints on serial port the pressure value expressed in millibar, the altitude expressed in meters and the temperature expressed in Celsius degrees.

About the third-party library, refer to https://github.com/pololu/lps-arduino.

Page 48: BlueEva+Sxx Arduino Starter Guide...BlueEva+Sxx Evaluation Kit has been designed to be assembled with Arduino Uno® board with aim to have an evaluation interface to be used taking

Recommended