aboutsummaryrefslogtreecommitdiff
path: root/hsm-cam/Test/Cam.hs
blob: 94d3b73cca3943644776b3e1eae1729dc740dd4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import Control.Monad (forM_)
import Data.Function ((&))
import Effectful (runEff)
import Effectful.FileSystem (runFileSystem)
import Effectful.FileSystem.IO.ByteString.Lazy (writeFile)
import Hsm.Cam (capturePng, runCam)
import Hsm.Log (Severity (Info, Trace), runLog)
import Prelude hiding (writeFile)

main :: IO ()
main =
  forM_ [0 .. 31] (\index -> capturePng >>= writeFile ("/tmp/hsm-cam-test" <> show @Int index <> ".png"))
    & runCam
    & runLog @"cam" Trace
    & runLog @"libcamera" Info
    & runFileSystem
    & runEff