From 70bff5c1285df6da24b8fc15dd8ef52c2775ee54 Mon Sep 17 00:00:00 2001 From: UnKnoWn-Consortium Date: Sun, 25 Jan 2015 00:04:30 +0000 Subject: [PATCH] Update ChangeUID.ino Updated code to account for serial behavior change in ATMEGA32U4 --- examples/ChangeUID/ChangeUID.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/ChangeUID/ChangeUID.ino b/examples/ChangeUID/ChangeUID.ino index aa3f53b..0a0a2ff 100644 --- a/examples/ChangeUID/ChangeUID.ino +++ b/examples/ChangeUID/ChangeUID.ino @@ -51,7 +51,8 @@ MFRC522::MIFARE_Key key; void setup() { Serial.begin(9600); // Initialize serial communications with the PC - SPI.begin(); // Init SPI bus + while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4) + SPI.begin(); // Init SPI bus mfrc522.PCD_Init(); // Init MFRC522 card Serial.println("Warning: this example overwrites the UID of your UID changeable card, use with care!");