MBot 0.1.0.1 → 0.1.0.2
raw patch · 2 files changed
+19/−10 lines, 2 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ MBot: goBackwards :: Device -> IO ()
Files
- MBot.cabal +1/−1
- src/MBot.hs +18/−9
MBot.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.1+version: 0.1.0.2 -- A short (one-line) description of the package. synopsis: Haskell interface for controlling the mBot educational robot
src/MBot.hs view
@@ -58,6 +58,7 @@ readUltraSonic, readLineFollower, goAhead,+ goBackwards, goLeft, goRight, stop,@@ -336,24 +337,32 @@ -- Example code to show how the motor commands work {-|- Start both motors so that the robot moves forward+ Start both motors so that the robot moves fowards -} goAhead d = do sendCommand d $ setMotor rightMotor speed stops- -- Sending negative speed (for left motor) use complement ! sendCommand d $ setMotor leftMotor (complement speed) (complement stops) ++ {-|- Start the motors let the mBot turn right+ Start both motors so that the robot moves backwards -}-goRight d = do sendCommand d $ setMotor leftMotor (complement stops) (complement stops)- sendCommand d $ setMotor rightMotor speed stops+goBackwards d = do sendCommand d $ setMotor rightMotor (complement speed) (complement stops)+ sendCommand d $ setMotor leftMotor speed stops ++ {-|- Start the motors so that the robots turns left + Start the motors let the mBot turn left -}-goLeft d = do sendCommand d $ setMotor rightMotor stops stops- -- Sending negative speed (for left motor) use complement !- sendCommand d $ setMotor leftMotor (complement speed) (complement stops)+goLeft d = do sendCommand d $ setMotor leftMotor stops stops+ sendCommand d $ setMotor rightMotor speed stops ++{-|+ Start the motors so that the robots turns right +-}+goRight d = do sendCommand d $ setMotor rightMotor stops stops+ sendCommand d $ setMotor leftMotor (complement speed) (complement stops) {-| Stop both motors