-
Notifications
You must be signed in to change notification settings - Fork 50
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
ArduinoUniqueID example tries to send data before serial comms established #19
Comments
This is the typical behaviour of the native-USB-Arduino. The AVR-Arduino using USB-to-serial are reset as soon as the USB-connection establishes. That's why it seams the Arduino is sending data "at the right time". In fact it just boots up, sends serial data even if nobody is listening and is being reset at the moment the USB-connection is established. I just wrote a snippet that emulates the oldfashioned way of e.g. UNO R3 (reset on connection) on a modern native-USB-device like UNO R4. Instead of waiting for connection by
|
@GralfR My solution: |
Hm, @newCityHunter, what did You expect to "fix the reboot problem"? My example does not reboot the device (unless You code into), but recognizes, if the USB is connected and runs with or without USB-connection (needed, if USB is used for debugging on native USB-boards and lateron the device should run without USB). |
Tested on an Arduino Micro the ArduinoUniqueID example tries to send serial data before comms are established and ends up sending nothing! Adding <while (!SerialUSB);> just after serial.begin fixed this issue for me :)
This issue also occurred for the ArduinoUniqueID8 example but the ArduinoUniqueIDSerialUSB example already had it and works all good!
The text was updated successfully, but these errors were encountered: