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

  1. #!/usr/bin/python
  2. import sys,serial
  3. def read_until(token):
  4. while 1:
  5. line = ser.readline(None)
  6. sys.stdout.write(line)
  7. if (line.startswith(token)):
  8. break
  9. return line
  10. ser = serial.Serial(sys.argv[1], 57600, timeout=5, dsrdtr=False, rtscts=False)
  11. read_until("+READY")
  12. ser.write(sys.argv[2])
  13. line = read_until("+OK")
  14. ser.close()
  15. if (line.find("PASS") != -1):
  16. sys.exit(0)
  17. else:
  18. sys.exit(1)