Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. int pin = 7;
  2. unsigned long duration;
  3.  
  4.  
  5. void setup()
  6. {
  7. pinMode(pin, INPUT);
  8. Serial.begin(9600);
  9. }
  10.  
  11. void loop()
  12. {
  13. duration = pulseIn(pin, HIGH);
  14.  
  15. Serial.println(duration);
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement