Advertisement
alseambusher

Untitled

Sep 29th, 2024
577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. class Message:
  2.     DELIMITER = "#"
  3.     arduino = serial.Serial(port=com_ports[2].device, baudrate=115200, timeout=0.1)
  4.     modes = ["boy", "girl", "dryrun", "default"]
  5.  
  6.     @staticmethod
  7.     def send(message):
  8.         mutex.acquire()
  9.         print(message)
  10.         Message.arduino.write((message + Message.DELIMITER).encode("utf-8"))
  11.         time.sleep(0.005)
  12.         print(Message.arduino.readline())
  13.         mutex.release()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement