-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Improve sketches that use Serial comunication #5336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add support for boards that use Native USB port Signed-off-by: Biagio Montaruli <biagio.hkr@gmail.com>
Thanks. I think https://www.arduino.cc/en/Serial/IfSerial should be updated too because it only refers to retired boards and not the newer ones. Regarding this, I think comments in commit should be more generic to avoid the problem above: something like "boards with native usb (refer to specific documentation)" could do the trick instead of enumerating the concrete models ("Zero, 101, etc"). On the other hand...maybe a mention in examples to the use of SerialUSB object (is defined in every board with native usb port?) would be appreciated. Thanks |
Hi @q2dg , |
Yes, specifying concrete board names is the best for newbies, I agree, but there's a lot of documentation in web which is outdated because of mentioning retired models...my suggestion was intended to prevent this in a future. But your reasoning it's perfectly fine, never mind. The SerialUSB object is defined in Zero and MKR1000 (https://github.com/arduino/ArduinoCore-samd/search?utf8=%E2%9C%93&q=serialusb), Micro (#4192) and 101 (https://github.com/01org/corelibs-arduino101/search?utf8=%E2%9C%93&q=serialusb). It seems to be an alias of Serial in some boards but (I think) not in all (sorry, I don't understand very well this, my programming level is horrible). Anyway, I suppose your commit is ok, never mind again. However, I insist (again!) to anyone who read this in updating web documentation regarding this topic: https://www.arduino.cc/en/Serial/IfSerial is outdated and, as @biagiom has pointed, https://www.arduino.cc/en/Reference/Serial too. Thanks |
Hi @q2dg,
|
This pull request can be closed because the modified sketches don't send data to the Serial monitor in the void setup() function and so the line while(!Serial) ; is not really necessary. |
Add support for boards that use Native USB port as Arduino/Genuino 101, Arduino/Genuino Zero, Arduino Due and boards based on ATMEGA32U4.