Beginning IoT Projects by Charles Bell

Beginning IoT Projects by Charles Bell

Author:Charles Bell
Language: eng
Format: epub
ISBN: 9781484272343
Publisher: Apress


Listing 10-1Bubble Level Header File

The code should be easy to read, and there are no surprises other than the details described previously. Let’s return to the main sketch to see how we can use this class.

Main Sketch

Now click the spirit_level.ino tab to return to the main sketch. Let’s begin with the preamble or top of the file. Recall here is where we include libraries we need, declare variables and constants, etc. We will also create functions to execute the calibration sequence, which is a bit more complex than what we are used to seeing, so we will walk through those functions separately.

We will look at the preamble first and then the setup() and loop() functions. Listing 10-2 shows the preamble code for the main sketch. As you can see, we include the wire, Serial LCD, Mux, and our new class headers.#include <Adafruit_LSM6DS33.h>

#include "BubbleLevel.h"



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.