Available in mbed, self-made library for Ultrasonic-sensor.
-
Add files to your working dir.
- ultrasonic.cpp
- ultrasonic.h
-
Pin:
Ultrasonic variable(triggerPin, echoPin);
-
Read value
variable.getDistance();
※
variable
: Users can rewrite the name as they like.
Reduce the amount of code to use ultrasonic sensors. This makes code refactoring and bug fixing easier.
.
├── main.cpp
├── ultrasonic.cpp
├── ultrasonic.h
├── LICENSE
└── README.md
Test script.
This file contains compiled functions and data, which are linked with main.cpp to create an executable program.
This file contains various definitions needed to use library functions, mainly class definitions.
Apache-2.0 license
This file.
OS | Windows 10 Pro |
IDE | Arm Keil Studio, Visual Studio Code |
HARD | STM32(test: F446RE), HC-SR04 |
LANG | C++ |
OTHERS | - |
Bugs and feature requests please visit GitHub Issues.
For less important matters, please contact us through the following means.
- Discord
- Account: Wassy#3241
- Server: https://discord.gg/uAUrUnwAh9