This repo contains everything needed to program Nicla Sense ME and to control it from another device. Further documentation can be found on the Arduino Docs website.
Nicla Sense ME belongs to Arduino Mbed OS boards and its core is available here. The packaged core can also be downloaded from Arduino IDE as ‘Arduino Mbed OS Nicla Boards’
Table of Contents:
Arduino_BHY2 - is the library to be included when making sketches for Nicla. It can be used for configuring bhi’s sensors and for retrieving bhi’s sensors data either from a sketch running on Nicla (standalone mode) or from an external device (thorugh eslov or BLE).
In examples there are already working examples for both scenarios:
Arduino_BHY2Host - is the library that an arduino board should include in order to control Uninsense through the eslov port. It can also act as a passthrough, to allow the control of Nicla from a PC. There is an example for both these use cases in examples:
bootloader - contains the source code for Nicla’s bootloader.
tools - contains the source code of the command line tool to control Nicla from a PC.
There is also a webserver mode that allows to control Nicla from a browser on your PC.
The bhy-controller
executable files for the main operating systems can be downloaded from the latest release.
In this use case, Nicla will be able to control its own sensors without the need for an external host.
A local web server has been implemented to manage Nicla from a browser. See browser compatibility.
BLE is used instead of eslov, thus there is no need for an intermediary arduino board.
./bhy webserver
to start the local web server.http://localhost:8000/index.html
web page with a browser listed in the compatibility list.
NB: make sure that WebBLE is enabled! If it is not, enable it from chrome://flags, setting “Experimental Web Platform features”.There are two web pages
sensor.html
allows to configure the sensors and read their values in real time.dfu.html
allows to update the firmware of either Nicla or bhi.The command line tool can be used to update the firmware of Nicla or bhi, manage Nicla’s sensors and read their values in real time. Refer to tools for the list of available commands. Here the eslov protocol is employed, so an arduino board is needed between Nicla and the PC.
The procedure to update the firmware is the same for both bhi and Nicla. You just need to specify the target during the procedure.
http://localhost:8000/index.html
- or directly go to http://localhost:8000/dfu.html
../bhy dfu -p YOUR_PORT -t TARGET -bin BIN_FILE
YOUR_PORT
with the serial port used by the arduino boardTARGET
with nicla
or bhi
BIN_FILE
with the path of the binary file to bu uploaded