Created
June 9, 2013 00:36
-
-
Save fgaray/5737116 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Hardware.Arduino | |
import Control.Monad (forever) | |
import Control.Monad.Trans (liftIO) | |
main :: IO () | |
main = do | |
putStrLn "Iniciando..." | |
loop | |
led = digital 13 | |
loop :: IO () | |
loop = withArduino False "/dev/cu.usbmodemfd131" $ forever$ do | |
liftIO $ do | |
putStrLn "Enter para encender" | |
getLine | |
digitalWrite led True | |
liftIO $ do | |
putStrLn "Enter para apagar" | |
getLine | |
digitalWrite led False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment