回复 7# xms77 #include 'CommMG.au3'
Global $light = 1
Global $sportSetError = ''
Global $CMPort = 2 ; Port
Global $CmBoBaud = 9600 ; Baud
Global $CmboDataBits = 8 ; Data Bits
Global $CmBoParity = "none" ; Parity
Global $CmBoStop = 1 ; Stop
Global $setflow = 2 ; Flow
_CommSetPort($CMPort, $sportSetError, $CmBoBaud, $CmboDataBits, $CmBoParity, $CmBoStop, $setflow)
$timer = TimerInit()
While 1
If TimerDiff($timer) >= 750 Then
_CommSendstring($light & "0" & @CR)
If $light = 1 Then
$light = 2
Else
$light = 1
EndIf
$timer = TimerInit()
EndIf
_CommSendstring($light & "0" & @CR)
Sleep(50)
_CommSendstring($light & "1" & @CR)
WEnd
win7 64位 |