-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell interface for controlling the mBot educational robot -- -- 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 ! @package MBot @version 0.2.2.0 -- |
-- 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 --module MBot -- | Opens a connection with the mBot openMBot :: IO Device -- | Close the connection with the mBot closeMBot :: Device -> IO () -- | Sends a mBot command over the HID device sendCommand :: Device -> Command -> IO () -- | Read out the status of the ultrasonic line follower readUltraSonic :: Device -> IO Float -- | Read out the status of line follower sensor readLineFollower :: Device -> IO Line -- | Create an mBot command for moving the motors setMotor :: Int -> Int -> Command -- | Create an mBot command to turn on the led on a particular rgb value setRGB :: Int -> Int -> Int -> Int -> Command -- | Contributed by: Rien Maertens Create an mBot command to sound a tone -- with the buzzer. playTone :: Int -> Int -> Command -- | The line sensor consists of two sensors which are able to detect -- either a black or a white surface. Therefore there are four different -- states to represent the state of the line sensor data Line -- | Left sensor reads black right sensor reads white LEFTB :: Line -- | Right sensor reads black left sensor reads white RIGHTB :: Line -- | Both the left and right sensor observe a black surface BOTHB :: Line -- | Both the left and right sensor observe a white surface BOTHW :: Line -- | Type of mBot commands the constructor is not exported. data Command instance GHC.Enum.Enum MBot.Action instance GHC.Classes.Eq MBot.Line instance GHC.Show.Show MBot.Line instance GHC.Classes.Eq MBot.Dev instance GHC.Enum.Enum MBot.Dev