This project aims to provide programs to perform temperature, humidity, and pressure measurements by means of a BME280 sensor connected to an Arduino Mega 2560.
It contains both Arduino sketch and GUI-based application for reading out data and putting into a text file on disk.
The code can be built and run on both Windows and Linux.
To build the code you will need a set of developer tools as well as a suited operating system. The code builds and runs on both Microsoft Windows and Linux operating systems.
In the following text %WSC% represents the folder where the WSC source
repository is located.
- a recent version of Microsoft Windows 64-bit
- Arduino IDE
- CMake v3.10 or newer
- Microsoft Visual Studio Community Edition
- Microsoft VCPKG
- Nullsoft Scriptable Install System (NSIS) (optional, for creating the installer)
A 64-bit MS Windows OS is required1. The procedure has been
tested on Windows 7 Ultimate and Windows 10.
1 It is actually required to build VCPKG, that in turn is
needed to build nana. If you find another easy way to do so, you may use
your 32-bit MS Windows system.
- Install
Arduino IDE. - In
Arduino IDEgo to "Tools->Library management". - Install the following libraries:
Adafruit Unified SensorsAdafruit BME280 LibraryOneWireDallasTemperature.
- Install Visual Studio 2017 Community Edition, that is free to use and downloadable from Microsoft Website.
- Install at least the following components:
- C++ Desktop Workload
- Git for Windows
Install vcpkg and the nana library:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg.exe install nana:x86-windows
vcpkg.exe export nana --raw --output %WSC%\wsc-dependencies\Download NSIS from the official website and install it in the default folder.
In a Developer Command Prompt for VS 2017:
cd %WSC%
mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x86-windows -DCMAKE_TOOLCHAIN_FILE="../wsc-dependencies/scripts/buildsystems/vcpkg.cmake" ..
nmake
REM the following is optional: to build the Windows install program
cpackIn the following text $WSC represents the folder where the WSC source
repository is located.
- a recent version of a Linux distibution (such as Ubuntu 18.04 or ArchLinux)
- Arduino IDE
- CMake v3.10 or newer
- GNU Make
- GNU Compiler Collection (gcc) 5 or newer
- nana C++ library
- Install
Arduino IDE. - In
Arduino IDEgo to "Tools->Library management". - Install the following libraries:
Adafruit Unified SensorsAdafruit BME280 LibraryOneWireDallasTemperature.
Follow the general instructions provided by your Linux distribution and/or the specific for each component to install all the requirements listed above.
On a Ubuntu system, the following instructions should be sufficient:
sudo apt update
sudo apt install -y git cmake build-essential libx11-dev libxft-dev
git clone https://github.com/cnjinhao/nana.git
cd nana/
mkdir bb
cd bb/
cmake ../ -DCMAKE_BUILD_TYPE=Release
sudo make install -jIn a shell:
cd $WSC
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../
make
# the following is optional: to build selfextracting tar archive
cpack