Skip to content

Commit

Permalink
enable stop on disconnect via sphero api
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Cervantes committed Jul 14, 2014
1 parent b74d4c4 commit 884f1e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions platforms/sphero/sphero_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func (s *SpheroDriver) Start() bool {
}()

s.configureCollisionDetection()
s.enableStopOnDisconnect()

return true
}
Expand Down Expand Up @@ -178,6 +179,10 @@ func (s *SpheroDriver) configureCollisionDetection() {
s.packetChannel <- s.craftPacket([]uint8{0x01, 0x40, 0x40, 0x50, 0x50, 0x60}, 0x12)
}

func (s *SpheroDriver) enableStopOnDisconnect() {
s.packetChannel <- s.craftPacket([]uint8{0x00, 0x00, 0x00, 0x01}, 0x37)
}

func (s *SpheroDriver) handleCollisionDetected(data []uint8) {
gobot.Publish(s.Event("collision"), data)
}
Expand Down

0 comments on commit 884f1e1

Please sign in to comment.