We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01fed47 commit 2476cd7Copy full SHA for 2476cd7
pca9685/pca9685.go
@@ -89,18 +89,14 @@ func (d Dev) Top() uint32 {
89
}
90
91
// Set sets the `on` value of a PWM channel in the range [0..15].
92
+// Max value `on` can take is 4095.
93
// Example:
94
// d.Set(1, d.Top()/4)
95
// sets the dutycycle of second (LED1) channel to 25%.
96
func (d Dev) Set(channel uint8, on uint32) {
- switch {
97
- case on > maxtop:
98
- panic("pca9685: value must be in range 0..4096")
99
- case on == 0:
100
- d.SetPhased(channel, 0, maxtop)
101
- return
+ if on > maxtop {
+ panic("pca9685: value must be in range 0..4095")
102
103
-
104
d.SetPhased(channel, on, 0)
105
106
0 commit comments