140_robot_H_Bridge8835_DIR_PWM_US_LCD
Dependencies: HCSR04 LCD_i2C_JDS
UP_US_Sensor.h
- Committer:
- itbusch
- Date:
- 2022-02-23
- Revision:
- 0:7f52b9bd4591
File content as of revision 0:7f52b9bd4591:
Timer timer; HCSR04 sensor(D2, D4); //Echo, Trugger Pin float Abstand; void Abstandsmessung (void) { timer.reset(); timer.start(); sensor.startMeasurement(); while(!sensor.isNewDataReady()) { // wait for new data // waiting time depends on the distance } Abstand = sensor.getDistance_mm(); timer.stop(); }