|
|
|
|
|
by gioscarab
1951 days ago
|
|
Ciao, yes I agree with you, I will work to remove parentheses from functions. What you would suggest instead of the arduino function names? You are right also about next and continue, thank you. The fact that the machine language is an ASCII string looks like really handy for many different reasons. |
|
Re: naming for IO functions, it's really up to you. I personally try to avoid abbreviations for readability, except for incredibly common ones.
One idea:
init_pin(index, mode) get_pin(index) get_pin_mode(index) set_pin_mode(index, mode)
Or CamelCase, InitPin, GetPin, etc.
Mode is an enum with values for input, input_pullup, input_pulldown, output_low, output_high.
For getting timestamps:
milliseconds() microseconds()
For computing deltas in time between two timestamps correctly with rollover (Provided by the system in case the data type is unsigned. Returns 0 if t2 > t1):
time_left(t1, t2)