Theil-Sen estimated median change in rain normalised soil moisture 2001-2016, Indonesia

Map: Theil-Sen estimated median change in rain normalised soil moisture 2001-2016, Indonesia

Install xspectre code

xSpectre spectrometer code

The xSpectre spectrometer v0.6 is run on Arduino IDE internal code and an Arduino33 IoT. This post covers how to clone the most recent version of the Arduino code and install it on the micro-controller.

Prerequisites

You have to have login rights to the Bitbucket repository at https://bitbucket.org/xspectre/arduino. You must also have installed the Arduino Integrated Development Environment (IDE). Dependent on your operating system you might also need to install specific drivers to actually connect your Arduino micro controller (board) to a usb-pot on your machine.

Cloning repo

If you have not previously cloned xspectre’s repository for Arduino https://bitbucket.org/xspectre/arduino/src/master you need to make an initial clone. If you already have a clone, you only need to pull any recent changes, and thus skip over the next section.

Initial cloning

Open a browser and navigate to

https://bitbucket.org/xspectre/arduino/src/master/
Master branch of the xspectre/arduino repo at Bitbucket.com.

Click on the Clone button and then select the cloning method (the default method HTTPS is fine). Copy the git clone command.

Select cloning method (HTTPS is fine).

Clone with terminal

Start a Terminal session and change directory cd to the parent directory where you want to store the local clone of the xspectre/arduino repo. Then just paste the copied code to the command line:

$ git clone https://user@bitbucket.org/xspectre/arduino.git

cd into the local clone:

$ cd arduino

List ls the content of the local clone:

$ ls
libraries	mojjang

The clone contains different files and folders used for the code development; the folders containing the code required for compiling and uploading to the spectrometer are under the directories libraries and mojjang.

Pull updates

If you already have a local clone of the xspectre/arduino repo, open a Terminal window and change directory cd to the clone top directory. Then just run the command:

$ git pull

Start Arduino

The main Arduino code (.ino) file is mojjang/mojjang.ino. To start Arduino IDE with this file, you can either use the terminal

$ cd mojjang
$ open mojjang

of start the Arduino IDE app and open the mojjang.ino from the menu:

File -> Open

Compile

The latest version of xSpectre´s spectrometer code should now be loaded into Arduino IDE:

mojjang.ino version 0.6, includes and declarations.

compile_btn

Try to compile the code using the check key (right). If the code does not compile and protests that a specific library is missing, you have to copy the library content from the cloned repo to the default path for Arduino defined when you installed the Arduino IDE.

Upload

upload_btn

Once you have compiled the .ino code file, upload it to the micro-controller by clicking the upload button (right).