Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Good catch! Well, it's actually a bit more complicated: the char gets promoted to a 16-bit int by the overload resolution of Serial.println(), then explicitly casted to long by Print::print(int, int), then converted to unsigned long by the call to printNumber(). Commented Jun 29, 2023 at 7:29
  • 1
    @EdgarBonet This issue happens a lot with beginners, and I had it many times already. :-D -- Thanks for going deep into the details! I feel the official Arduino documentation in the web as unsatisfactory, because I always miss the exact and complete prototypes. We should not have to look into the library source... Commented Jun 29, 2023 at 9:15
  • Thanks for your answer. Any idea why some of the garbage and random values are being received? Thansk Commented Jun 29, 2023 at 15:09
  • @SAndrew Which garbage and random values do you mean? I don't see any. Please post a new question if this is a separate issue, else edit your question. Commented Jun 30, 2023 at 6:06