We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 590ec3b commit 595bf94Copy full SHA for 595bf94
Python/LED.py
@@ -1,12 +1,20 @@
1
-import sys
2
-
3
-import navio.leds
4
import time
5
-import navio.util
+import os
+
+import navio.Common.util
+if navio.Common.util.get_navio_version() == "NAVIO2":
6
+ import navio.Navio2.Led as Led
7
+else:
8
+ import navio.Navio.Led as Led
9
10
-navio.util.check_apm()
11
+if (os.getuid() != 0):
12
+ print "Not root. Please, launch like this: sudo python LED.py"
13
+ exit(-1)
14
-led = navio.leds.Led()
15
+navio.Common.util.check_apm()
16
17
+led = Led()
18
19
led.setColor('Yellow')
20
print "LED is yellow"
@@ -37,3 +45,4 @@
37
45
38
46
39
47
time.sleep(1)
48
0 commit comments