Testrepo für alle Tests rund um Sensoren
25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #include "Arduino.h"
- #include <hcsr04.h>
-
- #define TRIG_PIN 12
- #define ECHO_PIN 11
-
- HCSR04 sr04(TRIG_PIN,ECHO_PIN);
- long a;
-
-
- //The setup function is called once at startup of the sketch
- void setup()
- {
- // Add your initialization code here
- Serial.begin(9600);
-
- Serial.println(__FILE__);
- delay(1000);
- }
-
- // The loop function is called in an endless loop
- void loop()
- {
- //Add your repeated code here
- a=sr04.distanceInMillimeters();
- Serial.print(a);
- Serial.println("mm");
- delay(1000);
-
- }
|