Browse Source

Added Import Constraint

master
Tim Schuster 2 years ago
parent
commit
9895878fd9
Signed by: Tim Schuster <mail@timschuster.info> GPG Key ID: F9E27097EFB77F61
3 changed files with 22 additions and 28 deletions
  1. 20
    26
      consts.go
  2. 1
    1
      helper.go
  3. 1
    1
      pca9685.go

+ 20
- 26
consts.go View File

@@ -1,34 +1,28 @@
1
-package adafruitPCA9685
2
-
3
-import (
4
-	"os"
5
-	"fmt"
6
-	"syscall"
7
-)
1
+package adafruitPCA9685 // import "go.rls.moe/misc/adafruitPCA9685"
8 2
 
9 3
 /* https://github.com/adafruit/Adafruit_Python_PCA9685/blob/master/Adafruit_PCA9685/PCA9685.py */
10 4
 
11 5
 const (
12
-	c_I2C_SLAVE = 0x0703
6
+	c_I2C_SLAVE       = 0x0703
13 7
 	c_PCA9685_ADDRESS = 0x40
14
-	c_MODE1 = 0x00
15
-	c_MODE2 = 0x01
16
-	c_SUBADR1 = 0x02
17
-	c_SUBADR2 = 0x03
18
-	c_SUBADR3 = 0x04
19
-	c_PRESCALE = 0xFE
20
-	c_LED0_ON_L = 0x06
21
-	c_LED0_ON_H = 0x07
22
-	c_LED0_OFF_L = 0x08
23
-	c_LED0_OFF_H = 0x09
24
-	c_ALL_LED_ON_L = 0xFA
25
-	c_ALL_LED_ON_H = 0xFB
26
-	c_ALL_LED_OFF_L = 0xFC
27
-	c_ALL_LED_OFF_H = 0xFD
8
+	c_MODE1           = 0x00
9
+	c_MODE2           = 0x01
10
+	c_SUBADR1         = 0x02
11
+	c_SUBADR2         = 0x03
12
+	c_SUBADR3         = 0x04
13
+	c_PRESCALE        = 0xFE
14
+	c_LED0_ON_L       = 0x06
15
+	c_LED0_ON_H       = 0x07
16
+	c_LED0_OFF_L      = 0x08
17
+	c_LED0_OFF_H      = 0x09
18
+	c_ALL_LED_ON_L    = 0xFA
19
+	c_ALL_LED_ON_H    = 0xFB
20
+	c_ALL_LED_OFF_L   = 0xFC
21
+	c_ALL_LED_OFF_H   = 0xFD
28 22
 
29 23
 	c_RESTART = 0x80
30
-	c_SLEEP = 0x10
24
+	c_SLEEP   = 0x10
31 25
 	c_ALLCALL = 0x01
32
-	c_INVRT = 0x10
33
-	c_OUTDRV = 0x04
34
-)
26
+	c_INVRT   = 0x10
27
+	c_OUTDRV  = 0x04
28
+)

+ 1
- 1
helper.go View File

@@ -1,4 +1,4 @@
1
-package adafruitPCA9685
1
+package adafruitPCA9685 // import "go.rls.moe/misc/adafruitPCA9685"
2 2
 
3 3
 import (
4 4
 	"time"

+ 1
- 1
pca9685.go View File

@@ -1,4 +1,4 @@
1
-package adafruitPCA9685
1
+package adafruitPCA9685 // import "go.rls.moe/misc/adafruitPCA9685"
2 2
 
3 3
 import (
4 4
 	"fmt"

Loading…
Cancel
Save