title: RFID RC522 Reading card wiringPi
body: <p>i am using raspberyy pi 3 , RFID RC522. I want to read a card using wiringPi. I am trying this codes;</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  #include&lt;wiringPi.h&gt;
  #include&lt;wiringPiSPI.h&gt;
  
  int main()
  {
      int chan = 1;
      int speed = 1000000;
  
      if (wiringPiSPISetup(chan, speed) == -1)
      {
          printf("Could not initialise SPI\n");
          return;
      }
      printf("When ready hit enter.\n");
      (void) getchar(); // remove the CR
      unsigned char buff[100];
  
      while (1)
      {
          int ret = wiringPiSPIDataRW(chan, buff, 4);
          printf("%d %s \n", ret, buff);
  
      }
  }
  </code></pre>
  
  <p>when I try this, it turns always '4'. How can read I don't understand. </p>