Safe Haskell | None |
---|---|
Language | Haskell98 |
To use any of these functions, you first must open a blink(1) device (providing the Blink
interface).
Currently System.Hardware.Blink1.Linux and System.Hardware.Blink1.USB are provided.
The functions ending with 2 provide functionality available on the blink(1) mk2, so are only likely to work if getVersion
returns ('2',_)
- data RGB a = RGB {}
- type RGB8 = RGB Word8
- newtype Delay = Delay {}
- data PatternStep
- data LED
- closeBlink1 :: Blink1 b => b -> IO ()
- getVersion :: Blink1 b => b -> IO (Char, Char)
- getColor2 :: Blink1 b => b -> LED -> IO RGB8
- setColor :: Blink1 b => b -> RGB8 -> IO ()
- setColor2 :: Blink1 b => b -> Maybe LED -> RGB8 -> IO ()
- fadeToColor :: Blink1 b => b -> Delay -> RGB8 -> IO ()
- fadeToColor2 :: Blink1 b => b -> Maybe LED -> Delay -> RGB8 -> IO ()
- setServerDown :: Blink1 b => b -> Bool -> Delay -> IO ()
- setServerDown2 :: Blink1 b => b -> Bool -> Delay -> Bool -> (PatternStep, PatternStep) -> IO ()
- playPattern :: Blink1 b => b -> Maybe PatternStep -> IO ()
- playPattern2 :: Blink1 b => b -> (PatternStep, PatternStep) -> Word8 -> IO ()
- getPlaying2 :: Blink1 b => b -> IO (Maybe (PatternStep, PatternStep, Word8, Word8))
- setPattern :: Blink1 b => b -> PatternStep -> Delay -> RGB8 -> IO ()
- getPattern :: Blink1 b => b -> PatternStep -> IO (Delay, RGB8)
- savePatterns2 :: Blink1 b => b -> IO ()
- getSerialNum :: Blink1 b => b -> IO Word32
- setSerialNum :: Blink1 b => b -> Word32 -> IO ()
- testBlink1 :: Blink1 b => b -> IO (Either [Word8] Bool)
Documentation
time is measured in centiseconds
data PatternStep Source
positions are counted 0-11 on mk1, 0-31 on mk2
LEDs are 1-based (0 means "all")
closeBlink1 :: Blink1 b => b -> IO () Source
setColor2 :: Blink1 b => b -> Maybe LED -> RGB8 -> IO () Source
Although documented, this does not appear to work correctly.
setServerDown :: Blink1 b => b -> Bool -> Delay -> IO () Source
enable/disable serverdown mode with the given timeout
setServerDown2 :: Blink1 b => b -> Bool -> Delay -> Bool -> (PatternStep, PatternStep) -> IO () Source
enable/disable serverdown mode with the given timeout, optionally staying on afterwards, over the given pattern range
playPattern :: Blink1 b => b -> Maybe PatternStep -> IO () Source
stop or start playing the sequence at the given position
playPattern2 :: Blink1 b => b -> (PatternStep, PatternStep) -> Word8 -> IO () Source
loop the sequence over a range some number of times.
getPlaying2 :: Blink1 b => b -> IO (Maybe (PatternStep, PatternStep, Word8, Word8)) Source
query the current play state.
setPattern :: Blink1 b => b -> PatternStep -> Delay -> RGB8 -> IO () Source
set the sequence pattern for the given position
getPattern :: Blink1 b => b -> PatternStep -> IO (Delay, RGB8) Source
savePatterns2 :: Blink1 b => b -> IO () Source
getSerialNum :: Blink1 b => b -> IO Word32 Source
This is only supported on mk1 devices.
setSerialNum :: Blink1 b => b -> Word32 -> IO () Source
This is only supported on mk1 devices.