Haskell interface for controlling the mBot educational robot
|Latest on Hackage:||0.2.4.0|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
MBot robot library
With this library it is possible to control the mBot robot from within Haskell over 2.4ghz wireless. The mBot itself needs to contain the standard firmware otherwise the library will not behave as expected. There is support for steering the motors and leds and for reading the linesensor and the ultrasonic sensor. An small example program is shown below, for more information about the individual functions take a look at the api documentation below.
import MBot main = do putStrLn "My first mBot program in Haskell !" -- Open the connection with the mMbot d <- openMBot putStrLn "Opened a connection with the mBot" -- Turn on led 1 of the mBot and set the RGB value to (0,100,0) sendCommand d $ setRGB 1 0 100 0 putStrLn "Look at all the pretty colors !" -- Turn on led 2 of the mBot and set the RGB value to (100,0,0) sendCommand d $ setRGB 2 100 0 0 -- close the connection with the mBot closeMBot d
Revision history for MBot
0.1.0.0 -- YYYY-mm-dd
First version. Released on an unsuspecting world.
- Rien Maertens contributed a function to play sound on the Mbot !