The Temperature Example shows how to use the temperature sensor inside the nRF52840 chip and print the measurement.
The application starts with configuring the temperature module and logging module. The main loop reads the temperature sensor and prints measurement every 500 milliseconds.
Before you start building, remember to set up the nRF5 SDK development environment first. See Setup the nRF5 SDK for details.
Building the example¶
You can find the source code and the project file of the example in the following folder: examples/nrf5-sdk/temperature.
Open terminal and navigate to the directory with the example Makefile:
make to build the example:
Programming the firmware¶
If compiled successfully, the firmware is located in
temperature/armgcc/_build with the name
Connect the debugger USB port to your PC using the provided USB-C Cable. A disk drive called M2-DOCK will be automatically detected by the computer.
Run the following command in
temperature/armgcc to program the board:
See Programming section for details about how to program the nRF52840 M.2 Module.
Test the example by performing the following steps:
screen /dev/cu.usbmodem14102 115200
In the terminal window, observe that a temperature value is printed every 500 milliseconds.
Create an Issue¶
Interested in contributing to this project? Want to report a bug? Feel free to click here: