Skip to content

Instantly share code, notes, and snippets.

@SeppPenner
Last active June 29, 2018 08:12
Show Gist options
  • Save SeppPenner/2df12e8f7fb058a3651913839998d468 to your computer and use it in GitHub Desktop.
Save SeppPenner/2df12e8f7fb058a3651913839998d468 to your computer and use it in GitHub Desktop.
Suggestion for Arduino parameters and return types

I would like to make a suggestion here, too.

image

I would organize the whole section from parameters to returns (See image) like the example shown below:

Parameters

Parameter name Parameter type Description Optional
pin int The number of the pin on which you want to read the pulse.
value int type of pulse to read: either HIGH or LOW.
timeout unsigned long the number of microseconds to wait for the pulse to start; default is one second

Returns

Return type Description
unsigned long the length of the pulse (in microseconds) or 0 if no pulse started before the timeout ()

For the Syntax section I personally would use the suggestion from @dkovari, like

Syntax

pulseIn(int pin, int value)

pulseIn(int pin, int value, unsigned long timeout)

Gist for example is here: https://gist.github.com/SeppPenner/2df12e8f7fb058a3651913839998d468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment