None Notebook

This notebook contains material from cbe61622; content is available on Github.

< 2.3 Particle Command Line Interface (CLI) | Contents | 2.5 Simple Stop Watch using Interrupts >

Open in Colab

Download

2.4 Ultrasonic Distance Ranger

Create a simple rangefinder that reports distance, measured in millimeters, to a real-time display.

2.4.1 Particle CLI

2.4.1.1 Installation

2.4.1.2 Utility functions

2.4.1.3 Login to Particle

2.4.1.4 Select a device

The following cell downloads a list of all user devices and creates a list of device names. Here we choose the first name in the list for the rest of this notebook. If this is not the device to be used, then modify this cell accordingly.

2.4.2 Project Hardware

2.4.2.1 Grove Ultrasonic Ranger

SeeedStudio description

The Grove Ultrasonic Ranger emits a sequence of eight short bursts of 40 kHz sonic signals, then measures duration until an echo is detected. The sonic signals are triggered by applying a 10 microsecond pulse to the GPIO pin connecting to the device. The duration until echo detection is returned as a pulse on the same GPIO pin. The pulse duration can be measured using the pulseIn() function of the standard Arduino or Particle API.

2.4.2.2 Grove 4 Digit Display

2.4.3 Implementation

2.4.3.1 Create Project

2.4.3.2 Change working directory

The Particle CLI assumes one is working in the top project directory.

2.4.3.3 Add relevant libraries

2.4.3.4 Create source file

2.4.3.5 Compiling

2.4.3.6 Flash firmware

< 2.3 Particle Command Line Interface (CLI) | Contents | 2.5 Simple Stop Watch using Interrupts >

Open in Colab

Download