--------------------------------------------------------------------------------- |-- Module : System.Hardware.Arduino.SamplePrograms.Blink-- Copyright : (c) Levent Erkok-- License : BSD3-- Maintainer : erkokl@gmail.com-- Stability : experimental---- The /hello world/ of the arduino world, blinking the led.-------------------------------------------------------------------------------moduleSystem.Hardware.Arduino.SamplePrograms.BlinkwhereimportControl.Monad(forever)importSystem.Hardware.Arduino -- | Blink the led connected to port 13 on the Arduino UNO board.---- Note that you do not need any other components to run this example: Just hook-- up your Arduino to the computer and make sure StandardFirmata is running on it.-- However, you can connect a LED between Pin13 and GND if you want to blink an-- external led as well, as depicted below:---- <<http://github.com/LeventErkok/hArduino/raw/master/System/Hardware/Arduino/SamplePrograms/Schematics/Blink.png>>blink ::IO()blink :: IO () blink =Bool -> FilePath -> Arduino () -> IO () withArduino Bool FalseFilePath "/dev/cu.usbmodemFD131"forall a b. (a -> b) -> a -> b $doletled :: Pin led =Word8 -> Pin digital Word8 13Pin -> PinMode -> Arduino () setPinMode Pin led PinMode OUTPUT forall (f :: * -> *) a b. Applicative f => f a -> f b foreverforall a b. (a -> b) -> a -> b $doPin -> Bool -> Arduino () digitalWrite Pin led Bool TrueInt -> Arduino () delay Int 1000Pin -> Bool -> Arduino () digitalWrite Pin led Bool FalseInt -> Arduino () delay Int 1000