Arduino Ethernet MRFC522

Hello, Im having some issues with Arduino+Xampp+Ethernet Shield.
Im trying to make a type of access control, have it all working out except one part of the code in arduino. Im using the MRFC522 to read tags and then insert into database the problem is, I need to read the personal data of the tags and I cant store it in a variable where I can then insert into the database.
Here is the part of the code where Im having troubles

for (uint8_t i = 0; i < 16; i++) {

char identificacao = buffer2[i]; 
Serial.write(identificacao ); // writes on the serial monitor the personal tag

cliente.print("GET /entradas/ethernet/data.php?");
cliente.print("numero=");
cliente.print(identificacao); // this part doesnt works because identificao its on char
cliente.println("HTTP/1.0");

cliente.println("Host: 192.168.1.100");

//Connecting and Sending values to database
cliente.stop(); //Closing the connection

If i switch identificacao for an int variable, a number etc it works but this way its not working.
Thanks in advance

The error is most probably in that part of the code you're hiding from us.

It wasnt, I managed to make it work by creating a variable with all arrays positivo buffer2[1] etc

So it was as I wrote.

Clearly. :+1:

It wasnt, I had to add this to the code

for (uint8_t i = 0; i < 2; i++) {
char identificaol[3];
identificaol[0] = buffer2[0];
identificaol[1] = buffer2[1];
identificaol[2] = buffer2[2];
int numero = atoi(identificaol);

char identificacao = buffer2[i];
Serial.write(identificacao );

the part of the identicaol[0] etc

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.