Go Down

Topic: Reading integers from SD card (Read 5158 times) previous topic - next topic


That's okay as it is but good practice says that when it's possible to get an error you really should check for and handle it even if the handling is to stop the program.

I see wayyyyy too little error trapping in most of the code here, it's all written as if it's going to work right and be used right every time. By the time something wrong is noticed you might have a nice set of symptoms to have to fixing what ain't broke, a great way to add bugs to code. But that's not the worst. Worse is when the program doesn't appear to behave wrong and has people trusting bad output as good.

I'm only putting this out so the beginners can get an idea of why to trap errors without having to find out completely the hard way. Completely because no matter how you try not to, you will find ways to be wro---errrr---end up with bugs if you write much non-trivial code.  :D
Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts


Thank you Dan! That works just how i want.


See this code - I can't index the file name, is this even possible?

I'm not sure what you mean by 'index the file name', or in what respect the sketch fails to do it.

index filename means 001.txt, 002.txt......etc

Go Up