Synopsis: A Haskell interface to Lego Mindstorms NXT
Description: A Haskell interface to Lego Mindstorms NXT over Bluetoooth. It supports direct commands, messages and
many sensors (also unofficial). It has also support for a simple message-based control of a NXT brick
Build-depends: base >= 4 && < 5,
bytestring >= 0.9 && < 1,
Exception for NXT interface errors. Currently only one exception is defined which takes textual description as an argument.
(Show a, Typeable a) => NXTException a = NXTException a deriving (Show, Typeable)
+data NXTException = NXTException deriving (Show, Typeable)
(Show a, Typeable a) => Exception (NXTException a)
+instance Exception NXTException
lastkeepalive :: Maybe POSIXTime -- last time keep alive has been sent
+instance Show NXTInternals where
+ show _ = "NXTInternals"
Runs a computation in a context of a given 'NXTInternals' token, returning a value and a new token.
-- | Be careful when using those functions as you have to assure your program is well-behaved: you should see 'NXTInternals' as a
- -- token you have to pass around in order, not reusing or copying values. They are exposed so that you can decouple initalization,
- -- execution and termination phase. If you do not need that use 'withNXT'.
- -- For example, using 'bracket' is not the best way to combine them together as token returned from 'initialize' in \"acquire resource\"
- -- phase is reused in \"release resource\" phase even if it was otherwise used in-between. Really use 'withNXT' for that.
+ -- token you have to pass around in order, not reusing or copying values. (The only exception is that you can reuse the token
+ -- initally returned by 'initialize' in 'terminate' call, even if you have used it in-between.) They are exposed so that you can
+ -- decouple initalization, execution and termination phase. If you do not need that use 'withNXT'.