1

For exmaple, I look at the page for digitalWrite and all I get is this for the signature:

digitalWrite(pin, value)

No return value type, no paramater type, nothing.

Instead, in a seperate section it says

Returns
Nothing

And then it says

Parameters
pin: the Arduino pin number.
value: HIGH or LOW.

What is "value"? An int? uint8_t? bool? Why is the API written in such a weird ambigious way?

I would expect something like

void digitalWrite(uint8_t pin, uint8_t value)

Like I am used to from other "proper" API documentations.

user84874
  • 19
  • 1
  • Because it's written for novices by novices – Majenko Apr 28 '22 at 16:44
  • I found `void digitalWrite(pin_size_t pinNumber, PinStatus status);`. that is why. – Juraj Apr 28 '22 at 17:06
  • Most pages in Language/Functions _do_ document the data types (I count 74 out of 137). This is more than it used to be, as documenting the types is an ongoing effort. You may participate by sending pull requests to [arduino/reference-en](https://github.com/arduino/reference-en). – Edgar Bonet Apr 28 '22 at 17:18
  • See [Specify data types in function definitions](https://github.com/arduino/reference-en/issues/15). I raised this issue in 2015 - that issue is still open 7 years later. – Nick Gammon Apr 29 '22 at 11:01
  • Try going to that Github page and supporting my request that the documentation be improved. Good luck! – Nick Gammon Apr 29 '22 at 11:03
  • re:"_What is "value"? An int? uint8_t? bool?_": all of those work in that context, so I don't see an issue. – dandavis Apr 29 '22 at 20:45

0 Answers0