Hardware components | ||||||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
Software apps and online services | ||||||
![]() |
| |||||
#include <HCSR04.h>
int triggerPin = 9;
int echoPin = 12;
void setup () {
Serial.begin(9600);
HCSR04.begin(triggerPin, echoPin);
}
void loop () {
double* distances = HCSR04.measureDistanceCm();
Serial.print("1: ");
Serial.print(distances[0]);
Serial.println("cm");
Serial.println("---");
delay(500);
}



_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)





_ptupTbatTg.jpg)

Comments