Step 3. Using Sensors
Overview
Step 3 of the tutorial is a simple walkthrough for using sensors.
We will alter some of the settings set in step 1 to execute the script to utilize a sensor.
Follow the page to develop using the neqto.js and neqto.js Libraries.
Hardware
- A temperature/humidity sensor from STMicroelectronics(HTS221) or an accelerometer from STMicroelectronics(LIS2DW12)
- neqto.js mounted module(NEQTO Bridge or Spresense)
- USB cable for connection
- PC
Step 1. Console preparation
When starting with this tutorial, we recommend that you use Step 1. Console Setting, using NEQTO Bridge, and using Spresense as reference.
Script Registration
Add the library with the following settings. Select the library according to the sensor you are using.
Meta data:
Field | Description |
---|---|
Name | Sensor Test |
Note | Optional Field |
Libraries:
Type | Name | Ver |
---|---|---|
I2C | HTS221_V2 or LIS2DW12_V2 | latest |
Select the newly created Script from the Script list menu and input the sample code based on the neqto.js library.
- When using Temperature/Humidity Sensor made by STMicroelectronics(HTS221)
- When using Accelerometer made by STMicroelectronics(LIS2DW12)
Template registration
Field | Description |
---|---|
Name | Sensor Template |
Device Type | Please select based on the model you use. |
Device Firmware | Please select latest firmware. |
Machine Driver Package | This is not required at this time, as we will not use any optional services. |
Script | Please select the previously registered script. |
Node editing
From the Node list view or the Node view, click the edit button (gear icon) of the Node where the device you wish to use is registered.
Please edit as follows:
Field | Description |
---|---|
Name | You do not need to edit. |
Note | You do not need to edit. |
Template | Please select the previously registered template. |
Please save your changes.
Step 2. Script execution
Refer to the following in advance to combine the hardware components and the sensor:
After starting the terminal software, connect the device to the PC while pressing the user switch to start in the User Console Mode.
After starting, enter the start
command to execute the script.
If a script was already running, click Reload Script on the Node in the NEQTO Console and check the terminal software again.
Related resources
- Spresense System Configuration
- NEQTO Bridge Digital IO Board
- Temperature / Humidity Sensor (HTS221)
- Accelerometer (LIS2DW12)
neqto.js Integration Libraries: