-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrite_date_blue.py
16 lines (14 loc) · 957 Bytes
/
write_date_blue.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import serial
import time
import struct
if __name__ == '__main__':
serialPort1 = serial.Serial(port='/dev/rfcomm1', baudrate=9600, timeout=0, parity=serial.PARITY_EVEN, stopbits=1, xonxoff =False, rtscts = False, dsrdtr = False)
serialPort2 = serial.Serial(port='/dev/rfcomm2', baudrate=9600, timeout=0, parity=serial.PARITY_EVEN, stopbits=1, xonxoff =False, rtscts = False, dsrdtr = False)
serialPort3 = serial.Serial(port='/dev/rfcomm3', baudrate=9600, timeout=0, parity=serial.PARITY_EVEN, stopbits=1, xonxoff =False, rtscts = False, dsrdtr = False)
serialPort4 = serial.Serial(port='/dev/rfcomm4', baudrate=9600, timeout=0, parity=serial.PARITY_EVEN, stopbits=1, xonxoff =False, rtscts = False, dsrdtr = False)
tempo = int(time.time())
print(tempo)
serialPort1.write(bytes( str(tempo), 'utf-8'))
serialPort2.write(bytes( str(tempo), 'utf-8'))
serialPort3.write(bytes( str(tempo), 'utf-8'))
serialPort4.write(bytes( str(tempo), 'utf-8'))