forked from tiker/TwoRC522RPi
-
Notifications
You must be signed in to change notification settings - Fork 7
/
run_main_test.py
43 lines (31 loc) · 1.09 KB
/
run_main_test.py
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
43
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Class in Python 2.7 for testing two RFID readers with Raspberry Pi.
Use:
$ cd TwoRC522RPi/
$ sudo python run_main_test.py
Press Ctrl + C to finish.
Credits and License: Created by Erivando Sena (2016)
* This program 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.
"""
import sys
from module.leitor_cartao import LeitorCartao
__author__ = "Erivando Sena Ramos"
__copyright__ = "Erivando Sena (2016)"
__email__ = "[email protected]"
__status__ = "Prototype"
def main(self):
reader_card = LeitorCartao()
try:
while True:
if not reader_card.isAlive():
reader_card.start()
except KeyboardInterrupt:
print "trl+C received! Sending kill to " + reader_card.getName()
if reader_card.isAlive():
reader_card._stopevent.set()
if __name__ == '__main__':
main(sys.argv)