Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SR04_Example.ino 258B

1234567891011121314151617
  1. #include "SR04.h"
  2. #define TRIG_PIN 3
  3. #define ECHO_PIN 4
  4. SR04 sr04 = SR04(ECHO_PIN,TRIG_PIN);
  5. long a;
  6. void setup() {
  7. Serial.begin(9600);
  8. delay(1000);
  9. }
  10. void loop() {
  11. a=sr04.Distance();
  12. Serial.print(a);
  13. Serial.println("cm");
  14. delay(1000);
  15. }