Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed refid-mpu6050
Diff: main.cpp
- Revision:
- 3:30e31f03d156
- Parent:
- 2:a0c7513fb634
- Child:
- 4:1de605217c11
--- a/main.cpp Fri Jun 06 03:04:48 2014 +0000
+++ b/main.cpp Sun May 08 13:27:52 2016 +0000
@@ -17,21 +17,28 @@
#include "MFRC522.h"
// Nucleo Pin for MFRC522 reset (pick another D pin if you need D8)
-#define MF_RESET D8
+#define MF_RESET p15
+#define SPI_MOSI p5
+#define SPI_MISO p6
+#define SPI_SCK p7
+#define SPI_CS p8
DigitalOut LedGreen(LED1);
//Serial connection to PC for output
-Serial pc(SERIAL_TX, SERIAL_RX);
+Serial pc(USBTX, USBRX);
MFRC522 RfChip (SPI_MOSI, SPI_MISO, SPI_SCK, SPI_CS, MF_RESET);
int main(void) {
- pc.printf("starting...\n");
+ pc.printf("starting...\r\n");
// Init. RC522 Chip
RfChip.PCD_Init();
+ pc.printf("init passed\r\n");
+
+
while (true) {
LedGreen = 1;
@@ -43,9 +50,10 @@
}
// Select one of the cards
- if ( ! RfChip.PICC_ReadCardSerial())
+ if (!RfChip.PICC_ReadCardSerial())
{
wait_ms(500);
+ pc.printf("card read\r\n");
continue;
}