質問編集履歴

4

修正

2021/01/08 04:14

投稿

c-s
c-s

スコア3

test CHANGED
File without changes
test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
 
14
14
 
15
- ''''''''''''''''python
15
+ ``````````````````````````python
16
16
 
17
17
  import sys
18
18
 
@@ -112,4 +112,4 @@
112
112
 
113
113
 
114
114
 
115
- '''''''''''''''''''''''''''''''''''''''''''''''''
115
+ `````````````````````````````````````````````````

3

修正

2021/01/08 04:14

投稿

c-s
c-s

スコア3

test CHANGED
File without changes
test CHANGED
@@ -10,9 +10,9 @@
10
10
 
11
11
 
12
12
 
13
- ----------------------
14
13
 
15
14
 
15
+ ''''''''''''''''python
16
16
 
17
17
  import sys
18
18
 
@@ -109,3 +109,7 @@
109
109
  if __name__ == '__main__':
110
110
 
111
111
  main()
112
+
113
+
114
+
115
+ '''''''''''''''''''''''''''''''''''''''''''''''''

2

修正

2021/01/08 04:13

投稿

c-s
c-s

スコア3

test CHANGED
File without changes
test CHANGED
@@ -27,8 +27,6 @@
27
27
 
28
28
 
29
29
  def data_send(buf):
30
-
31
- #while(comport.out_waiting == 1):
32
30
 
33
31
  while True:
34
32
 

1

送り側追加

2021/01/08 00:47

投稿

c-s
c-s

スコア3

test CHANGED
File without changes
test CHANGED
@@ -23,6 +23,28 @@
23
23
 
24
24
 
25
25
  comport = serial.Serial("COM1", baudrate=115200, parity=serial.PARITY_NONE, timeout=None)
26
+
27
+
28
+
29
+ def data_send(buf):
30
+
31
+ #while(comport.out_waiting == 1):
32
+
33
+ while True:
34
+
35
+ if comport.out_waiting == 0:
36
+
37
+ break
38
+
39
+
40
+
41
+ data = buf +'\r\n'
42
+
43
+ send_data = data.encode('UTF-8')
44
+
45
+ comport.write(send_data)
46
+
47
+ return
26
48
 
27
49
 
28
50
 
@@ -64,7 +86,11 @@
64
86
 
65
87
 
66
88
 
67
- print(recieve_data)
89
+ print(recieve_data)
90
+
91
+     data_send(recieve_data)
92
+
93
+
68
94
 
69
95
 
70
96