I'm having some problems here, what's happening is the following, I have a project that I need to simulate a school call on the PIC and make it save in Excel, the project requires that I can change the students' entrance and exit times , and also faults and presences, but I have not added that part since I am facing problems to make the pic save the call in excel, I made this array that would be where I would save the data of each student (Note, there are 32 students, I took the personal data as names and RG and left only the most futile things, but I believe that if I can do with 2, I can do with 32):
const char *a[33][13] = {
{"Numero:","Turma:","Aluno:","RG:","Entrada:","Saida:","Entrou:","Saiu:","Aula 1:","Aula 2:","Aula 3:","Aula 4:","Aula 5:"},
{"0l","TURMA","ALUNO1","Numerode12digitos","07:30","11:30","00:00","00:00","F","F","F","F","F"},
{"02","TURMA","ALUNO2","Maisumnumerode12digitos","07:30","11:30","00:00","00:00","F","F","F","F","F"},
So I just wanted to save that in excel, and I made the code below for this ...
/*funções e variáveis externas não influenciam na parte do Excel, são apenas para aplicações futuras, podendo registrar hoa de entrada e saida do aluno*/
extern void leitura_i2c(), menufinal();
extern char Entrou[6], Saiu[6], rfid[13];
extern char segundos, minutos, horas, dia, semana, mes, ano, turma, nmr;
extern unsigned short flags;
extern const char *a[33][13];
#define txt flags.B6
char filename[11] = "DataXX.csv";
char temp[17];
//Aqui dentro da função Chamada é onde estou tendo problemas, não estou conseguindo fazer ele salvar no excel cada elemento da chamada(apenas ";" e "\r")
void Chamada()
{
int l,col;
Mmc_Fat_Assign(&filename, 0xA0);
Mmc_Fat_Set_File_Date(ano+2000, mes, semana, horas, minutos, segundos);
Mmc_Fat_Append();
for(l=0;l<33;l++)
{
for(col=0;col<13;col++)
{
temp[17]=(EL4M[l][col]);
Mmc_Fat_Write(temp,17);
if(col<12)
{Mmc_Fat_Write(";",1);}
}
Mmc_Fat_Write("\r",2);
}
menufinal(); //Apenas uma confirmação de finalização no display
}
void Delete_File()
{
Mmc_Fat_Assign(&filename, 0);
Mmc_Fat_Delete();
}
short Test_File_Exist()
{
return Mmc_Fat_Assign("DATA00.csv", 0);
}
void Open_File_Read()
{
unsigned long i, size;
char caracter;
Mmc_Fat_Assign(&filename, 0);
Mmc_Fat_Reset(&size);
for (i = 1; i <= size; i++)
{
Mmc_Fat_Read(&caracter);
UART1_Write(caracter);
}
}
But when I save, the variable temp is empty, as if I had not saved anything inside it, I put it because MickroC did not allow to use directly the variable of the call ... Software used is the MicroC Pro, PIC 18F4620. Any questions you may have, I need help with this.