Gathered scripts
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#=========Custom=========
|
||||
requests >= 2.32.5
|
||||
python-dotenv >= 1.2.1
|
||||
pyyaml >= 6.0.3
|
||||
|
||||
#=========OpenApi=========
|
||||
python_dateutil >= 2.5.3
|
||||
setuptools >= 21.0.0
|
||||
urllib3 >= 1.25.3, < 2.1.0
|
||||
pydantic >= 2
|
||||
typing-extensions >= 4.7.1
|
||||
|
||||
#=========Custom=========
|
||||
requests >= 2.32.5
|
||||
python-dotenv >= 1.2.1
|
||||
pyyaml >= 6.0.3
|
||||
pyserial
|
||||
0
rpi/scripts/__init__.py
Normal file
0
rpi/scripts/__init__.py
Normal file
0
rpi/scripts/rfid/__init__.py
Normal file
0
rpi/scripts/rfid/__init__.py
Normal file
30
rpi/scripts/rfid/main.py
Normal file
30
rpi/scripts/rfid/main.py
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import serial
|
||||
import time
|
||||
from grovepi import *
|
||||
|
||||
ser = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=1)
|
||||
ser.flush()
|
||||
|
||||
while True:
|
||||
data = b""
|
||||
print(data)
|
||||
while len(data) < 14:
|
||||
c = ser.read(1)
|
||||
if c:
|
||||
data += c
|
||||
else:
|
||||
continue
|
||||
|
||||
if len(data) >= 11:
|
||||
hex_value = data[5:11].decode(errors='ignore')
|
||||
|
||||
try:
|
||||
res = int(hex_value, 16)
|
||||
print(res)
|
||||
|
||||
except ValueError:
|
||||
print("Invalid hex:", hex_value)
|
||||
else:
|
||||
print("Received incomplete data:", data)
|
||||
0
rpi/scripts/timer/__init__.py
Normal file
0
rpi/scripts/timer/__init__.py
Normal file
Reference in New Issue
Block a user