Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.
jputcu edited this page Apr 10, 2011 · 4 revisions

Reset Arduino

The reset of Arduino is attached to the DTR, Data Terminal Ready line. By toggling this line, the processor will reset.

import System.Hardware.Serialport
import Control.Concurrent

main :: IO ()
main = do
  s <- openSerial "/dev/ttyUSB0" defaultSerialSettings -- for POSIX
  -- s <- openSerial "COM7" defaultSerialSettings -- for Windows
  setDTR s False
  threadDelay 500000
  setDTR s True
  closeSerial s
Clone this wiki locally