arduino-libraries / SD

SD Library for Arduino
http://arduino.cc/
GNU General Public License v3.0
182 stars 154 forks source link

corrected typo in msg printed when SD Card fails to initialize #79

Closed Inv3nt0r1 closed 2 years ago

Inv3nt0r1 commented 4 years ago

Hello, This PR fixes a typo in the message printed by Serial.print() when the SD card fails to initialize that can misguide new users.

This fixes an issue #78

@per1234 Please review.

Thank you.

AsherThomasBabu commented 4 years ago

@Inv3nt0r1 , If you have used the serial monitor, you will know that this is a normal feature of the Arduino rather than a typo, wherein the sketch is restarted whenever the serial monitor is opened. Therefore hitting the reset button or reopening the serial monitor does the same thing essentially.

The Arduino UNO actually uses the /DTR line to trigger a reset, whenever a serial connection is opened or closed.

You can read more about it here: https://arduino.stackexchange.com/questions/439/why-does-starting-the-serial-monitor-restart-the-sketch

Thank You Asher

Inv3nt0r1 commented 4 years ago

Wow! My bad. Closing PR.
Apologies

Edit: Thank you! :)

per1234 commented 4 years ago

the sketch is restarted whenever the serial monitor is opened

This is only true for the Arduino boards that use an external USB to serial adapter chip that uses the DTR trick you mentioned. It is not true when using a native USB board (e.g., Leonardo, MKR, Nano 33 IoT, Nano 33 BLE). The serial connection with Serial Monitor is also lost when those boards are reset, so you do need to both a reset and a Serial Monitor restart to get the example sketches to start again and show serial output.

At the time those instructions were written, it's likely all Arduino boards had the reset on Serial Monitor open behavior, so they were correct at that time. Most of Arduino's new boards now have native USB, so the existing instructions become even more outdated over time.

So I think this is a good change to make. Ideally, the correction to the existing instructions would be made in one PR, then the propagation of the instructions to the other examples in another, so that each proposed change could be decided on individually. However, I don't think the level of non-atomicity of this PR is too serious of an issue.

AsherThomasBabu commented 4 years ago

So I think this is a good change to make. Ideally, the correction to the existing instructions would be made in one PR, then the propagation of the instructions to the other examples in another, so that each proposed change could be decided on individually. However, I don't think the level of non-atomicity of this PR is too serious of an issue.

@per1234 Thank you for the knowledge, I wasn't aware of the nature USB thing. Apologies! Asher

Inv3nt0r1 commented 4 years ago

@per1234 Thank you so much for this information. I appreciate your efforts and they are always really helpful to everyone.

So should I reopen this PR? Because I think this change should be made to the examples. Or should I do that correction in one PR and replicate that to other examples in another PR?

Thank you so much again. Durgesh

per1234 commented 4 years ago

I wasn't aware of the nature USB thing. Apologies!

No worries. This is a complicated subject. Your information was correct for the subset of boards which don't have native USB capabilities, just not for all Arduino boards.

So should I reopen this PR? Because I think this change should be made to the examples. Or should I do that correction in one PR and replicate that to other examples in another PR?

The choice is yours. I've given my opinion in my previous reply, for what it's worth. I'm not the person who will make the decision as to whether this PR will be merged.

Inv3nt0r1 commented 4 years ago

The choice is yours. I've given my opinion in my previous reply, for what it's worth. I'm not the person who will make the decision as to whether this PR will be merged.

Okay. Thank you for your efforts. I am opening this PR again, and if devs think this is a useful addition, they can merge this.

Thank you, I appreciate all of your efforts.

Durgesh

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.