|
|
|
|
|
by gergoerdi
3881 days ago
|
|
As always, prefer prebuilt recursion scheme combinators instead of making your own. The following, using `forever`, is IMO much more readable because you don't have to mentally resolve the recursion: main :: IO ()
main = withFile ledFile AppendMode $ \h -> do
let put s = hPutStrLn h s >> threadDelay 2000000
forever $ do
put "0"
put "1"
where
ledFile = "/sys/class/leds/beaglebone:green:usr0/brightness"
|
|