Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. void loop() {
  2. digitalWrite(triggerpin, HIGH); //Setting the triggerpin high for 10us to
  3. // generate a wave
  4. delayMicroseconds(10);
  5. digitalWrite(triggerpin, LOW);
  6.  
  7. //At this point the ultrasonic bursts would have been generated and the echo
  8. //pin would have been set to high according to the
  9. // ultrasonic sensor datasheet. If so then why is the below pulseIn() function
  10. //working.
  11.  
  12.  
  13. time = pulseIn(echopin, HIGH);
  14.  
  15. //some more code
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement