Click for More

Good day i have also a question because im just a beginers for arduino i have only one project but im so stress for this can you please help me, I think it simple for you.
Basic only

I have sdcard atach spi to arduino
I have pushbutton atach in pin.

I like to print a one line to serial port from sdcard

And every press button i like to print new line from sd card and soon

The file save in sd card is
10
09
08
07
06
05
04
03
02
01

I like that when pressed button it will print from sd to serial the number
And another pressed will print next number
And soon until reach the number 01.

Can you please help me.


Hellow guys can i ask question.
I have problem with my code because im only beginners
Can you help my for this

I like to press button and print the inside of sd but in every press supose to be only one line and press again and print the second line and soon but the problem is it will print the all inside of sd card which not good
Can you please help me
I will show you my code

First of all, DON'T hijack threads!

Next, sure, show us your code and tell where you're stuck. "Does not work" is NOT a problem description!

And a pro tip, just like the compiler we're a lot happier with the right syntax :wink: Aka, try to separate sentences with a period (.) and a Capital :wink:

@Murphy1992, please do not cross-post. Posts smashed together.

Ahhh, fantastic job! Cross post AND hijack!

And any reason to store something extremely trivial like that on a SD-card??

the structure of the code is simple, right ?

while file is not empty
   read a line from file
   print the line to Serial
   wait for button press (and decide if you want to wait for release)

So you have 4 functions to write

  • fileisnotempty()
  • readalinefromfile()
  • printthelinetoSerial()
  • waitforbuttonpress()

:slight_smile: