Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pin = 7;
- unsigned long duration;
- void setup()
- {
- pinMode(pin, INPUT);
- Serial.begin(9600);
- }
- void loop()
- {
- duration = pulseIn(pin, HIGH);
- Serial.println(duration);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement