fixed wrong led off/on register setting
This commit is contained in:
17
main.go
17
main.go
@@ -1,19 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"gen/ledd"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/op/go-logging"
|
||||
"golang.org/x/exp/io/i2c"
|
||||
"gopkg.in/yaml.v2"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"encoding/binary"
|
||||
"gen/ledd"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"fmt"
|
||||
"math"
|
||||
)
|
||||
|
||||
// CONSTANTS
|
||||
@@ -89,7 +88,7 @@ func (daemon *LedDaemon) receive() {
|
||||
switch msg := backendMsg.Msg.(type) {
|
||||
case *ledd.BackendWrapperMessage_MLedd:
|
||||
daemon.name = msg.MLedd.Name
|
||||
log.Infof("Connection with %s etablished; backend registered", msg.MLedd.Name)
|
||||
log.Infof("Connection with %s established; backend registered", msg.MLedd.Name)
|
||||
case *ledd.BackendWrapperMessage_MSetChannel:
|
||||
for c, v := range msg.MSetChannel.NewChannelValues {
|
||||
if c > CHANNEL {
|
||||
@@ -98,7 +97,7 @@ func (daemon *LedDaemon) receive() {
|
||||
}
|
||||
|
||||
vPerc := float64(v) / float64(RESOLUTION)
|
||||
vPerc = math.Pow(vPerc, 1/readConfig.Pca9685.Gamma)
|
||||
//vPerc = math.Pow(vPerc, 1/readConfig.Pca9685.Gamma)
|
||||
|
||||
if pwm, ok := pwmMap[c]; ok {
|
||||
pwm.setPercentage(float32(vPerc * 100))
|
||||
|
Reference in New Issue
Block a user