user70337:  for (byte i = 0; i < mfrc522.uid.size; i++)
  {
    Serial.print(mfrc522.uid.uidByte{i} < 0x10 ? " 0" : " ");
    Serial.print(mfrc522.uid.uidByte{i}, HEX);
    content.concat(String(mfrc522.uid.uidByte{i} < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte{i}, HEX));
  }

I use this code to get UID of an RFID card, but the error "expected ')' before '{' token" comes out. Does anybody know how to solve this problem?

user31105: Welcome to this site, next time use ctrl-k to align your code.
The problem is in:
Serial.print(mfrc522.uid.uidByte{i} < 0x10 ? " 0" : " ");

To get the value of an array, use [i], not {i}, thus
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");

(similar to other lines).
To give some additional hints:

Try to prevent duplicated code by storing the byte into a variable. Now you can use uidValue in the subsequent lines.
uint8_t uidValue = mfrc522.uid.uidByte[i];

Store 0x10 inside a constant.


So you get:
const uint8_t MAX_HEX_SINGLE_DIGIT_VALUE 0x0F;

for (byte i = 0; i < mfrc522.uid.size; i++)
{
    uint8_t uid_byte = mfrc522.uid.uidByte[i];
    Serial.print(uid_byte < LOW_VALUE <= MAX_HEX_SINGLE_DIGIT_VALUE ? " 0" : " ");
    Serial.print(uid_byte, HEX);
    content.concat(String(uid_byte < MAX_HEX_SINGLE_DIGIT_VALUE ? " 0" : " "));
    content.concat(String((uid_byte, HEX));
  }

I assume the Serial lines are only for debugging, otherwise you can combine them too.

70337: <pre><code> for (byte i = 0; i &lt; mfrc522.uid.size; i++)
  {
    Serial.print(mfrc522.uid.uidByte{i} &lt; 0x10 ? &quot; 0&quot; : &quot; &quot;);
    Serial.print(mfrc522.uid.uidByte{i}, HEX);
    content.concat(String(mfrc522.uid.uidByte{i} &lt; 0x10 ? &quot; 0&quot; : &quot; &quot;));
    content.concat(String(mfrc522.uid.uidByte{i}, HEX));
  }
</code></pre>
<p>I use this code to get UID of an RFID card, but the error <code>&quot;expected ')' before '{' token&quot;</code> comes out. Does anybody know how to solve this problem?</p>
 31105: <p>Welcome to this site, next time use ctrl-k to align your code.</p>
<p>The problem is in:</p>
<pre><code>Serial.print(mfrc522.uid.uidByte{i} &lt; 0x10 ? &quot; 0&quot; : &quot; &quot;);
</code></pre>
<p>To get the value of an array, use <code>[i]</code>, not <code>{i}</code>, thus</p>
<pre><code>Serial.print(mfrc522.uid.uidByte[i] &lt; 0x10 ? &quot; 0&quot; : &quot; &quot;);
</code></pre>
<p>(similar to other lines).</p>
<p>To give some additional hints:</p>
<ul>
<li><p>Try to prevent duplicated code by storing the byte into a variable. Now you can use <code>uidValue</code> in the subsequent lines.</p>
<p>uint8_t uidValue = mfrc522.uid.uidByte[i];</p>
</li>
<li><p>Store 0x10 inside a constant.</p>
</li>
</ul>
<p>So you get:</p>
<pre><code>const uint8_t MAX_HEX_SINGLE_DIGIT_VALUE 0x0F;

for (byte i = 0; i &lt; mfrc522.uid.size; i++)
{
    uint8_t uid_byte = mfrc522.uid.uidByte[i];
    Serial.print(uid_byte &lt; LOW_VALUE &lt;= MAX_HEX_SINGLE_DIGIT_VALUE ? &quot; 0&quot; : &quot; &quot;);
    Serial.print(uid_byte, HEX);
    content.concat(String(uid_byte &lt; MAX_HEX_SINGLE_DIGIT_VALUE ? &quot; 0&quot; : &quot; &quot;));
    content.concat(String((uid_byte, HEX));
  }
</code></pre>
<p>I assume the Serial lines are only for debugging, otherwise you can combine them too.</p>
