Fixed PWM init bug for C.H.I.P

Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>
This commit is contained in:
Erik Agsjö 2017-05-30 23:27:51 +02:00 committed by deadprogram
parent 3070419f83
commit b5dccfbc01
1 changed files with 3 additions and 3 deletions

View File

@ -179,15 +179,15 @@ func (c *Adaptor) PWMPin(pin string) (sysfsPin sysfs.PWMPinner, err error) {
if err = newPin.Export(); err != nil { if err = newPin.Export(); err != nil {
return return
} }
if err = newPin.InvertPolarity(false); err != nil {
return
}
if err = newPin.Enable(true); err != nil { if err = newPin.Enable(true); err != nil {
return return
} }
if err = newPin.SetPeriod(10000000); err != nil { if err = newPin.SetPeriod(10000000); err != nil {
return return
} }
if err = newPin.InvertPolarity(false); err != nil {
return
}
c.pwmPins[sysPin.pwmPin] = newPin c.pwmPins[sysPin.pwmPin] = newPin
} }