Using one tilt switch

Let's start by attaching one of the tilt switches. Using one instead of all four at the same time makes it easier to verify that it is working and to understand how it works:

  1. Connect one of the tilt switches in the same way as in the following diagram—one pin connected to ground, the other to pin 0:

Arduino MKR WiFi 1010 connected to a tilt switch (this image was created with Fritzing) License: (https://creativecommons.org/licenses/by-sa/3.0/)

In reality, this will look something like this:

Arduino MKR WiFi 1010 and ...

Get Hands-On Internet of Things with MQTT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.