diff --git a/Language/Functions/Advanced IO/pulseIn.adoc b/Language/Functions/Advanced IO/pulseIn.adoc index d1df8544f..893c67ce4 100644 --- a/Language/Functions/Advanced IO/pulseIn.adoc +++ b/Language/Functions/Advanced IO/pulseIn.adoc @@ -53,7 +53,7 @@ the length of the pulse (in microseconds) or 0 if no pulse started before the ti [float] === Example Code // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ -The example calculated the time duration of a pulse on pin 7. +The example prints the time duration of a pulse on pin 7. [source,arduino] ---- @@ -62,12 +62,14 @@ unsigned long duration; void setup() { + Serial.begin(9600); pinMode(pin, INPUT); } void loop() { duration = pulseIn(pin, HIGH); + Serial.println(duration); } ---- [%hardbreaks] diff --git a/Language/Functions/Advanced IO/pulseInLong.adoc b/Language/Functions/Advanced IO/pulseInLong.adoc index 22940fd55..36f935f54 100644 --- a/Language/Functions/Advanced IO/pulseInLong.adoc +++ b/Language/Functions/Advanced IO/pulseInLong.adoc @@ -55,7 +55,7 @@ the length of the pulse (in microseconds) or 0 if no pulse started before the ti [float] === Example Code // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ -The example calculated the time duration of a pulse on pin 7. +The example prints the time duration of a pulse on pin 7. [source,arduino] ---- @@ -63,11 +63,13 @@ int pin = 7; unsigned long duration; void setup() { + Serial.begin(9600); pinMode(pin, INPUT); } void loop() { duration = pulseInLong(pin, HIGH); + Serial.println(duration); } ---- [%hardbreaks]