Skip to content

Commit

Permalink
Merge pull request hybridgroup#654 from chmorgan/dev
Browse files Browse the repository at this point in the history
pwm_pin - Fix DutyCycle() parse error, need to trim off trailing '\n'…
  • Loading branch information
trevrosen authored Jan 29, 2019
2 parents aa34bc3 + 756d38d commit 2255be2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sysfs/pwm_pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ func (p *PWMPin) DutyCycle() (duty uint32, err error) {
return
}

val, e := strconv.Atoi(string(buf))
v := bytes.TrimRight(buf, "\n")
val, e := strconv.Atoi(string(v))
return uint32(val), e
}

Expand Down

0 comments on commit 2255be2

Please sign in to comment.