tisdag 6 oktober 2015

Platform 5/10

At Monday 5/10, we had our platform good functioning will some design corrections needed to be made. 

Before the presentation we worked really hard to find a solution to have 3 RFID-readers to work. We realized that we don't need the RFID-readers to read simultaneously, just one at a time. 

To highlight the game again:
A player starts the game and take a seat in front of the wall. In front of the wall, three shapes should be placed: triangle, circle and rectangle. Each of this shapes got an matching hole in the wall. When the game starts, one of the holes will light up, the child now need to chose the right shape and place it against the hole. If the right shape is in place in time (some time limitation will be needed), the player gets one point, indicated on the top by a LED. The next shape now lights up and the procedure is the same. For each rond that is succeed, the time limit will be shorter. 

Back to the topic. As described above, we just need one RFID-reader to search at a time. After playing with the example code that was found on the RFID-readers website, in combination of searching a solution online we manage to find a solution. 

The pin RST, MOSI, MISO, SCK could be shared across the three readers. Only the SDA pin was needed to be unique. See scheme below. The pins was first defined and then we created three instances of the readers by "MFRC522 mfrc522(SS_PIN, RST_PIN);" for example for the first pin. Then we initialized the instanced by for example: "mfrc522.PCD_Init();"

 /*
 * Pin layout
 * --------------------------
 * MFRC522    |  Arduino Uno Pin
 * --------------------------
 * RST              |  7/ICSP-5 (shared)                   
 * MOSI           |  ICSP-4   (shared)  
 * MISO           |  ICSP-1   (shared) 
 * SCK             |  ICSP-3   (shared) 
 * SDA1 (SS)   |  9        (reader 1)
 * SDA2 (SS)   |  10      (reader 2)
 * SDA3 (SS)   |  6       (reader 3)
 */

The program (beta-version) was then structured to search with the reader 1 and at the same time light a LED to indicate what RFID-reader was used. After 5 seconds of searching, the program switched to the next RFID-reader and LED. If the right shape* was held at the right hole, an green LED lighted up to indicate the success. 

* The shape was at this phase created by a wood part with a RFID-tag taped to it. In a later phase this will be clad in fabric, probably in some sort of animal pattern. 

Inga kommentarer:

Skicka en kommentar