The MBot package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

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]

Properties

Versions0.1.0.0, 0.1.0.1, 0.1.0.1, 0.1.0.2, 0.1.1.0, 0.1.2.0, 0.2.0.0, 0.2.1.0, 0.2.2.0
Change logChangeLog.md
Dependenciesbase (>=4.8 && <4.10), bytestring (==0.10.*), hidapi (==0.1.*), mtl (==2.2.*) [details]
LicenseGPL-3
AuthorChristophe Scholliers
MaintainerChristophe.Scholliers@UGent.be
CategoryEducational
UploadedSun Nov 6 12:51:30 UTC 2016 by cfscholl

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for MBot-0.1.0.1

[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