Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59
This commit is contained in:
16
arduino/read_HCSR04.ino
Normal file
16
arduino/read_HCSR04.ino
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#include <HCSR04.h>
|
||||||
|
|
||||||
|
HCSR04 distSensor(5, 4); //initialisation class HCSR04 (trig pin , echo pin, number of sensor)
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
Serial.begin(9600);
|
||||||
|
|
||||||
|
pinMode(4, INPUT);
|
||||||
|
pinMode(5, OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop()
|
||||||
|
{
|
||||||
|
Serial.println(distSensor.dist());
|
||||||
|
delay(100);
|
||||||
|
}
|
Reference in New Issue
Block a user