Ein Roboter mit bürstenlosem Antrieb, differenzial und NRF24L01 Funk. Großflächig gebaut um ein großes Solarpanel aufzunehmen.
https://gitlab.informatik.hs-fulda.de/fdai5253/roboter
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
405 B
25 lines
405 B
#!/usr/bin/python
|
|
|
|
import sys,serial
|
|
|
|
def read_until(token):
|
|
while 1:
|
|
line = ser.readline(None)
|
|
sys.stdout.write(line)
|
|
|
|
if (line.startswith(token)):
|
|
break
|
|
return line
|
|
|
|
|
|
ser = serial.Serial(sys.argv[1], 57600, timeout=5, dsrdtr=False, rtscts=False)
|
|
|
|
read_until("+READY")
|
|
ser.write(sys.argv[2])
|
|
|
|
line = read_until("+OK")
|
|
ser.close()
|
|
if (line.find("PASS") != -1):
|
|
sys.exit(0)
|
|
else:
|
|
sys.exit(1)
|