teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

2021/07/31 10:54

投稿

dyrobin
dyrobin

スコア13

title CHANGED
File without changes
body CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  上記を実現するために、色々調べ、実験してきて、以下のコードにたどり着きました。
6
6
  ```python
7
+ testgpio.py
7
8
  #!/usr/bin/env python
8
9
  # coding:utf-8
9
10
  from websocket_server import WebsocketServer
@@ -40,6 +41,7 @@
40
41
 
41
42
 
42
43
  ```python
44
+ testsub.py
43
45
  #!/usr/bin/env python
44
46
  # coding:utf-8
45
47
  from websocket_server import WebsocketServer
@@ -56,8 +58,8 @@
56
58
 
57
59
  print("LED消灯中")
58
60
  time.sleep(1)
59
- #server = WebsocketServer(9001, host="192.168.43.57")
61
+ server = WebsocketServer(9001, host="192.168.43.57")
60
- #server.send_message_to_all("LED消灯中")
62
+ server.send_message_to_all("LED消灯中")
61
63
 
62
64
 
63
65
  elif GPIO.input(27) == 1:

1

コード修正

2021/07/31 10:54

投稿

dyrobin
dyrobin

スコア13

title CHANGED
File without changes
body CHANGED
@@ -4,7 +4,6 @@
4
4
 
5
5
  上記を実現するために、色々調べ、実験してきて、以下のコードにたどり着きました。
6
6
  ```python
7
- testgpio.py
8
7
  #!/usr/bin/env python
9
8
  # coding:utf-8
10
9
  from websocket_server import WebsocketServer