-- 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.1.0.2 -- |
-- 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 -- | Start both motors so that the robot moves fowards goAhead :: Device -> IO () -- | Start both motors so that the robot moves backwards goBackwards :: Device -> IO () -- | Start the motors let the mBot turn left goLeft :: Device -> IO () -- | Start the motors so that the robots turns right goRight :: Device -> IO () -- | Stop both motors stop :: Device -> IO () -- | Create an mBot command to turn on the led on a particular rgb value setRGB :: Int -> Int -> 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