Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "windows.bi"
- dim as handle MYPORT
- dim as integer BytesWrite
- MYPORT = CreateFile("COM11:19200",GENERIC_WRITE or GENERIC_READ,0,null,OPEN_EXISTING,null,null)
- if MYPORT = 0 or MYPORT = INVALID_HANDLE_VALUE then
- print "Failed to open port..."
- else
- print "port Opened!!!"
- dim as string Text = "Hello World"
- if WriteFile(MYPORT,strptr(Text),len(Text),@BytesWrite,null) then
- print "Writed " & BytesWrite & " Byte to COM11 port"
- else
- print "Failed to write to the port..."
- end if
- CloseHandle(MYPORT)
- end if
- sleep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement