An Arduino library to give environmental sensors a common interface of functions for use with Arduino-framework dataloggers, such as the EnviroDIY Mayfly.
Search for symbols, directories, files, pages or
topics. You can omit any prefix from the symbol or file path; adding a
: or / suffix lists all members of given symbol or
directory.
Use ↓
/ ↑ to navigate through the list,
Enter to go.
Tab autocompletes common prefix, you can
copy a link to the result using ⌘L while ⌘M produces a Markdown link.
This somewhat trivial example show making use of the unified set of commands to print data from a MaxBotix ultrasonic range finder to the serial port. It also shows creating a calculated variable which is the water depth.
Unique Features of the Single Sensor Example
Only communicates with and collects data from a single sensor.
Does not make use of any VariableArray or logging features.
To Use this Example
Prepare and set up PlatformIO
Create a new PlatformIO project
Replace the contents of the platformio.ini for your new project with the platformio.ini file in the examples/single_sensor folder on GitHub.
It is important that your PlatformIO configuration has the lib_ldf_mode and build flags set as they are in the example.
Without this, the program won't compile.
Open single_sensor.ino and save it to your computer. Put it into the src directory of your project.
Delete main.cpp in that folder.
Upload!
Upload and see what happens
PlatformIO Configuration
1; PlatformIO Project Configuration File
2;
3; Build options: build flags, source filter
4; Upload options: custom upload port, speed and extra flags
5; Library options: dependencies, extra library storages
6; Advanced options: extra scripting
7;
8; Please visit documentation for the other options and examples