Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- COM_Port := "\\.\COM3" ; Вкажіть правильний COM порт, до якого підключено Arduino
- hSerial := DllCall("CreateFile", "Str", COM_Port, "UInt", 0xC0000000, "UInt", 3, "UInt", 0, "UInt", 3, "UInt", 0, "UInt", 0)
- Loop {
- VarSetCapacity(Buffer, 256)
- DllCall("ReadFile", "Ptr", hSerial, "Str", Buffer, "UInt", 256, "UIntP", 0, "UInt", 0)
- if InStr(Buffer, "Motion detected") {
- Send, #d ; Натискає комбінацію клавіш Win + D
- }
- Sleep, 100
- }
- OnExit:
- DllCall("CloseHandle", "Ptr", hSerial)
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment