Jump to content

Reading from serial ports with FileRead


paulpmeier
 Share

Recommended Posts

A usefull feature of the FileOpen function:

FileOpen("Com1", 4) opens the first serial port for binary input.

The exsample shows reading NMEA-data from a GPS receiver via Com4.

HotKeySet("{ESC}", "Terminate")

$file = FileOpen("COM4", 4)
While 1
    $chr = FileRead($file, 1)
    ConsoleWrite($chr)
WEnd

Func Terminate()
  FileClose($file)
  Exit
EndFunc

Posted Image

See also: Console Input - Read from console with FileRead

Link to comment
Share on other sites

Great, thanks!

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

  • 1 month later...
  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...