Skip to content
Snippets Groups Projects
Select Git revision
  • 2023ss
  • 2025ss default
  • 2024ss
  • 2022ss
  • 2021ss
  • 2020ss
  • 2019ss
  • 2018ss
8 results

templates-10.cpp

Blame
  • serial_id.py 459 B
    """Return the id of the arduino connected to the first serial port. id 0 is for Temperaturmessung, id 1 for DMSMessung
    """
    import time
    import serial
    
    if __name__ == "__main__":
        with serial.Serial("/dev/ttyACM0", 9600, timeout=3) as con:
            while True:
                con.write(1)
    
                try:
                    print(int(con.readline().decode("utf-8")))
                    break
                except (TypeError, ValueError):
                    time.sleep(1)