Skip to content

Commit

Permalink
Make it working with latest Arduino
Browse files Browse the repository at this point in the history
  • Loading branch information
Radek Pilar committed Jun 27, 2013
1 parent a27fef3 commit 6d3a029
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions brmdoor/brmdoor.ino
Expand Up @@ -2,8 +2,7 @@

#define MUSIC 1

#include "SoftwareSerial.h"

#include <SoftwareSerial.h>
// pins
const int magnetPin = 10;
const int soundPin = 9; /* piezo in series with 100R */
Expand Down Expand Up @@ -108,10 +107,10 @@ void readCard()
byte NoCardResponse[] = { 0xAA, 0x00, 0x02, 0x01, 0x83, 0x80, 0xBB };
byte buf[16];
int i;

rfidSerial.listen();
// write query to serial
for (i = 0; i < 8; i++)
rfidSerial.print(RequestCardStatus[i]);
rfidSerial.write((uint8_t)RequestCardStatus[i]);
// wait for the result, while reblinking
delay(100);
digitalWrite(statusLed, statusState);
Expand All @@ -125,7 +124,6 @@ void readCard()
}
++i;
}

// no card is detected
if (!memcmp(buf, NoCardResponse, 7)) {
comSerial.write("NOCARD\n");
Expand Down Expand Up @@ -188,8 +186,8 @@ void setup()
digitalWrite(statusBtn, HIGH);
pinMode(videoBtn, INPUT);
digitalWrite(videoBtn, HIGH);
rfidSerial.begin(9600);
comSerial.begin(9600);
rfidSerial.begin(9600);
}

void loop()
Expand Down

0 comments on commit 6d3a029

Please sign in to comment.