how to read textfile using arrays

hi,i am trying to use arrays to read text from a file on another location before sending it out byte by byte but i not very familiar with using arrays for my coding.Kindly take a look at my source code,thanks.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
void loop()
{

  char Msg[]={"Hello"};
  char *start;
  int i=0;

  // Creating a connection to a device
  if(!BT.createConnection("0017E5F1CD3B","02"))//It creates a connection to the desired device which is operating on the service channel '02'
  {
    USB.println("");
    USB.print("--- CONNECTION -- MTU: ");
    USB.print(BT.connection_mtu[0],BYTE);//Stores the maximum amount of data that can be sent
    USB.print(BT.connection_mtu[1],BYTE);
    USB.println(BT.connection_mtu[2],BYTE);    
  }
  else USB.println("Connection failed");

  start=Msg;
  
  // Sending the data to the opened connection
  if(USB.println("Data sent OK");
  else USB.println("Error while sending data");
      
  // Removing the connection previously opened 
  if(!BT.removeConnection()) USB.println("Connection removed");
  else USB.println("Error while removing connection");  
  
  // Removing a trusted device
  if(!BT.removeTrustedDevice("0017E5F1CD3B")) USB.println("Trusted Device removed");//0017E5F1CD3B==MAC address of PDA

  else USB.println("Error while removing trusted device");

  // Powering Down BT
  BT.OFF();
}
Topic archived. No new replies allowed.