WIP: implement device logic for game #1
@@ -1,6 +1,7 @@
|
||||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
#include <MFRC522.h>
|
||||
#include <SPI.h>
|
||||
|
||||
#define SDA_PIN 21
|
||||
#define SCL_PIN 22
|
||||
@@ -10,9 +11,13 @@
|
||||
// Card reader pins
|
||||
#define READER_COUNT 6
|
||||
|
||||
#define RST_PIN 9
|
||||
#define MISO_PIN 19
|
||||
#define MOSI_PIN 23
|
||||
#define SCK_PIN 18
|
||||
|
||||
#define SS_ONE_PIN 10
|
||||
#define RST_PIN 27
|
||||
|
||||
#define SS_ONE_PIN 26
|
||||
#define SS_TWO_PIN 5
|
||||
#define SS_THREE_PIN 4
|
||||
#define SS_FOUR_PIN 2
|
||||
@@ -33,6 +38,7 @@ const byte READER_ADDRESSES[READER_COUNT] = {
|
||||
0x04, 0x05, 0x06, 0x07, 0x08, 0x09};
|
||||
|
||||
// List of proper cards uuid's
|
||||
// TODO: Update this UUID's to the specific cards that will be used
|
||||
const byte CORRECT_UIDS[READER_COUNT][4] = {
|
||||
{0xDE, 0xAD, 0xBE, 0xEF}, // Reader 1
|
||||
{0xCA, 0xFE, 0xBA, 0xBE}, // Reader 2
|
||||
@@ -67,6 +73,9 @@ void setup()
|
||||
|
||||
Wire.onRequest(requestEvent);
|
||||
|
||||
// Initialize SPI with specified pins
|
||||
SPI.begin(SCK_PIN, MISO_PIN, MOSI_PIN, -1);
|
||||
|
||||
initializeReaders();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user