-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwriter.py
More file actions
42 lines (33 loc) · 1 KB
/
writer.py
File metadata and controls
42 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python
"""
This application writes strings read in from the terminal to a wristband
This application writes string data to the RFID tag and does not verify the number of sectors on the wristbands
The general use is:
SSH into PI
Remove all RFID tags from scanner
Start Program:
Enter location string
Place RFID tag on scanner
Verify that location was written correctly
Remove tag from scanner
goto Start Program
"""
import HackPSUrfid as rfid
import time
#raw_input for py2 or input for py3
while True:
print("Please place wristband on scanner")
location = raw_input("Enter a location ID: ")
print("Location registered as: " + location)
print("Please scan an RFID tag now")
while not rfid.detectBand():
pass
uid = rfid.getUID()
print("Writing to UID: " + uid)
oldLoc = rfid.readLocation()
print("Old location string: " + oldLoc)
rfid.writeLocation(location)
newLoc = rfid.readLocation()
print("New location string: " + newLoc)
print("Please remove wristband")
time.sleep(1)