lukasmaximus89
Published © LGPL

Grove Ultrasonic Sensor with M5Stack

Simple setup of a Seeed Studio Grove ultrasonic sensor (not HC-SR04) in Arduino.

BeginnerProtip1 hour381
Grove Ultrasonic Sensor with M5Stack

Things used in this project

Hardware components

M5Stack FIRE IoT Development Kit (PSRAM 2.0)
M5Stack FIRE IoT Development Kit (PSRAM 2.0)
×1
Grove - Ultrasonic Ranger
Seeed Grove - Ultrasonic Ranger
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

ultrasonicM5Stack

Arduino
simple setup for using the ultrasonic ranger with m5stack
//Make sure to install

#include <M5Stack.h>
#include "Ultrasonic.h"

Ultrasonic ultrasonic(22);
void setup()
{
  M5.begin();
}
void loop()
{
	long RangeInInches;
	long RangeInCentimeters;

	RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval
	M5.Lcd.setCursor(10, 0);
	M5.Lcd.print(RangeInCentimeters);//0~400cm
  //M5.Speaker.tone(RangeInCentimeters, 200);
	delay(250);
}

Credits

lukasmaximus89

lukasmaximus89

38 projects • 6 followers
I'm Luke from Manchester, UK. I've been living in shenzhen for 6 years. I do 3D design, Basic Electronics, Casting and other cool stuff.

Comments

Add projectSign up / Login