MBot: Haskell interface for controlling the mBot educational robot

[ educational, gpl, library ] [ Propose Tags ]

This is a library to control the mBot robot with haskell. This will only work when you connect the robot with the default firmware over 2.4ghz the Bluetooth version is not supported !

[Skip to Readme]


[Index] [Quick Jump]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS],,,,,,,,,,
Change log ChangeLog.md
Dependencies base (>=4.8 && <=, bytestring (>=0.10 && <0.11), hidapi (>=0.1 && <0.2), mtl (>=2.2 && <2.3) [details]
License GPL-3.0-only
Author Christophe Scholliers
Maintainer Christophe.Scholliers@UGent.be
Category Educational
Uploaded by cfscholl at 2018-07-23T08:07:30Z
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 7747 total (26 in the last 30 days)
Rating 2.5 (votes: 3) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-07-23 [all 1 reports]

Readme for MBot-

[back to package description]

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