質問編集履歴

1

起動をIDLEからコンソールへ変更しました

2018/01/30 07:51

投稿

ReoReo
ReoReo

スコア6

test CHANGED
File without changes
test CHANGED
@@ -35,3 +35,41 @@
35
35
 
36
36
 
37
37
  以上。よろしくお願いします
38
+
39
+
40
+
41
+ ###追記
42
+
43
+ ソースコードのexit()を消し、コンソールで実行したとき以下のエラー分が出ました
44
+
45
+ ```
46
+
47
+ init MegaPi
48
+
49
+ <megapi.mSerial instance at 0x767e8dc8>
50
+
51
+ Traceback (most recent call last):
52
+
53
+ File "imp.py", line 5, in <module>
54
+
55
+ bot.start()
56
+
57
+ File "/usr/local/lib/python2.7/dist-packages/megapi.py", line 83, in start
58
+
59
+ self.device.start(port)
60
+
61
+ File "/usr/local/lib/python2.7/dist-packages/megapi.py", line 15, in start
62
+
63
+ self.ser = serial.Serial(port,115200,timeout=10)
64
+
65
+ File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__
66
+
67
+ self.open()
68
+
69
+ File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
70
+
71
+ raise SerialException("could not open port %s: %s" % (self._port, msg))
72
+
73
+ serial.serialutil.SerialException: could not open port /dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0'
74
+
75
+ ```