Law & Legal & Attorney Wills & trusts

How to Use QBasic to Write to Port

    Programming the Parallel Port

    • 1). Set the output of the port in the form:

      OUT [port],[number]

      Where [port] is the communications port. You can find this information by clicking "Start" and selecting "My Computer." Right-click the device you wish to use, and select "Properties." Use the COM port listed on the device you're programming with QBasic.

      When setting the number, each time you send information the previous information is cleared. Therefore, you'll want to reduce the steps so it will keep your information in memory. For example, you can use the following code:

      'set port to 10000000

      OUT 888, 1

      or, you can use:

      'set port to 10110000

      OUT 888, 11

      Set more than one node to the "ON" position (0 is off, 1 is on).

    • 2). Set the input of the port in this form:

      PortNum%=INP(888)

      Where "PortNum%" is a variable to set the value of the data line, to keep in memory for future use.

    • 3). Merge previous codes together to finish a task in QBasic in the following format:

      OUT 888, 43

      PortNum%=INP(888)

      PRINT PortNum%

      This piece of code will have the parallel port output the number 43 into the variable "PortNum%," which is then shown on the screen using the print function.

Related posts "Law & Legal & Attorney : Wills & trusts"

How to Find the Midpoint of a Line in AutoCAD

Wills & trusts

How to Find XML Encoding

Wills & trusts

How to Create a Variable Output Frequency

Wills & trusts

Successor Trustee

Wills & trusts

What Can Be Seized in a Search Warrant?

Wills & trusts

How to Recycle Textile Products

Wills & trusts

Affordable Immigration Lawyer:what To Ask When Wanting For An Immigration Lawyer

Wills & trusts

How to Gain Access to a Dead Relative's Safe Deposit Box

Wills & trusts

Can I Create a Subdirectory as Part of a Subdomain?

Wills & trusts

Leave a Comment