1
0
Fork 0
mirror of https://github.com/kidoman/embd synced 2025-07-03 03:47:33 +02:00

us020: client should ensure rpio is initialised before using

This commit is contained in:
Karan Misra 2014-02-08 02:21:01 +05:30
parent 96a92383e2
commit d2ffacd22c
2 changed files with 4 additions and 5 deletions

View file

@ -61,10 +61,6 @@ func (d *US020) setup() (err error) {
d.mu.Lock()
defer d.mu.Unlock()
if err = rpio.Open(); err != nil {
return
}
d.echoPin = rpio.Pin(d.EchoPinNumber) // ECHO port on the US020
d.triggerPin = rpio.Pin(d.TriggerPinNumber) // TRIGGER port on the US020
@ -134,5 +130,4 @@ func (d *US020) Distance() (distance float64, err error) {
// Close.
func (d *US020) Close() {
d.echoPin.Output()
rpio.Close()
}