Skip to content

Instantly share code, notes, and snippets.

@fgaray
Created June 9, 2013 00:36
Show Gist options
  • Save fgaray/5737116 to your computer and use it in GitHub Desktop.
Save fgaray/5737116 to your computer and use it in GitHub Desktop.
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