forked from londonhackspace/Doorbot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add arduino project and code to just get a tag ID
- Loading branch information
1 parent
b4a2a82
commit 33b0e23
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
int triggerPin = 9; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(9600); | ||
pinMode(9, OUTPUT); // digital sensor is on digital pin 2 | ||
} | ||
|
||
void loop() | ||
{ | ||
if (Serial.available() > 0) { | ||
char inByte = Serial.read(); | ||
|
||
if (inByte == '1') { | ||
// Strobe a little | ||
for (int i = 0; i < 2; i++) { | ||
digitalWrite(triggerPin, HIGH); | ||
delay(100); | ||
digitalWrite(triggerPin, LOW); | ||
delay(30); | ||
} | ||
delay(500); // Pause to ensure it resets | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/python | ||
|
||
# readtag.py - read all sectors from a standard tag | ||
# | ||
# Adam Laurie <adam@algroup.co.uk> | ||
# http://rfidiot.org/ | ||
# | ||
# This code is copyright (c) Adam Laurie, 2006, All rights reserved. | ||
# For non-commercial use only, the following terms apply - for all other | ||
# uses, please contact the author: | ||
# | ||
# This code is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This code is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
|
||
|
||
import RFIDIOtconfig | ||
import sys | ||
import os | ||
|
||
try: | ||
card= RFIDIOtconfig.card | ||
except: | ||
os._exit(True) | ||
|
||
while True: | ||
|
||
#card.info('readtag v0.1d') | ||
card.select() | ||
if card.uid is not None: | ||
print '\nID: ' + card.uid | ||
|
||
|
||
|
||
|
||
os._exit(True) |