Pages: [1]   Go Down
Author Topic: read sd  (Read 567 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


someone can say me why this code do not works

Code:

  String cadena[1]={"key.txt"};
  if (SD.exists(cadena[0])) digitalWrite(led,HIGH);

Logged

Milan
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

try this
Code:
 
 char cadena[1][8]={"key.txt"};
  if (SD.exists(cadena[0])) digitalWrite(led,HIGH);

or
Code:

  String cadena[1]={String("key.txt")};
  char buf[8];
  cadena[0].toCharArray(buf,8);
  if (SD.exists(buf)) digitalWrite(led,HIGH);

amz
Logged

AMZ

Central MN, USA
Online Online
Tesla Member
***
Karma: 72
Posts: 7175
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do not cross post!

Potential helpers read what this member has been doing:

http://forum.arduino.cc/index.php?action=profile;u=170985;sa=showPosts;start=0
Logged


Pages: [1]   Go Up
Jump to: