barcode scanner vb.net textbox Using the Port to Operate a Robot: The Basics in Software

Creation Data Matrix 2d barcode in Software Using the Port to Operate a Robot: The Basics

Using the Port to Operate a Robot: The Basics
Data Matrix Decoder In None
Using Barcode Control SDK for Software Control to generate, create, read, scan barcode image in Software applications.
Create ECC200 In None
Using Barcode creation for Software Control to generate, create Data Matrix image in Software applications.
The 74367 used in the Robot Experimenter s Interface cannot sink or source more than about 20 mA of current per output, and as you would expect you can t operate a motor directly from it. However, it can drive a low-power relay, transistor, or H-bridge. See 18, Working with DC Motors, for some popular ways to bridge the low-level output of the interface to control a real-world robot. The simplest way to operate your robot via computer is to connect each of the data output lines to a suitable transistor, small relay, or H-bridge input. You can control the on/off state of up to eight motors or other devices using just the eight data lines of the parallel port (you can actually control even more devices; more on this in a bit). Let s say that you only have three motors connected to the interface and that you are using lines 0, 1, and 2 (pins 2, 3, and 4, respectively). To turn on motor 1, you must
Reading Data Matrix In None
Using Barcode decoder for Software Control to read, scan read, scan image in Software applications.
Data Matrix Generation In Visual C#.NET
Using Barcode encoder for .NET Control to generate, create DataMatrix image in VS .NET applications.
V Vgn
ECC200 Generator In .NET Framework
Using Barcode printer for ASP.NET Control to generate, create Data Matrix 2d barcode image in ASP.NET applications.
Make Data Matrix 2d Barcode In .NET
Using Barcode generation for Visual Studio .NET Control to generate, create DataMatrix image in VS .NET applications.
FIGURE 30.7 A blank Robot Experimenter s Interface layout. Feel free to copy it and use it to make your own designs.
DataMatrix Maker In VB.NET
Using Barcode maker for Visual Studio .NET Control to generate, create ECC200 image in .NET framework applications.
Paint Code 128 Code Set A In None
Using Barcode maker for Software Control to generate, create Code 128 Code Set C image in Software applications.
470 COMPUTER CONTROL VIA PC PRINTER PORT
Encoding EAN / UCC - 13 In None
Using Barcode maker for Software Control to generate, create EAN-13 Supplement 5 image in Software applications.
Drawing UCC.EAN - 128 In None
Using Barcode creator for Software Control to generate, create EAN128 image in Software applications.
activate the bit for line 0, that is, make it HIGH. To do this, output a bit pattern number to the port using the BASIC OUT command. The OUT command is used to send data to an I/O port. The command is used with two parameters: port address and value. The two are separated by a comma. For port address, use the base address of the parallel port; for data, use the value you want to send to the port. Here s an example:
Draw GS1 - 12 In None
Using Barcode drawer for Software Control to generate, create UPC-A Supplement 5 image in Software applications.
Barcode Encoder In None
Using Barcode generator for Software Control to generate, create bar code image in Software applications.
OUT 888, 10
GTIN - 14 Encoder In None
Using Barcode creator for Software Control to generate, create ITF14 image in Software applications.
UPC Symbol Generation In Visual C#
Using Barcode creation for Visual Studio .NET Control to generate, create UPC A image in .NET applications.
(Note: In the test code you used variables, BaseAddress and DataPort, instead of hardwired literal values for the port address. It s a better practice to use variables because that makes it easier to change your program. For right now, however, I ll use literal values such as 888 for short examples, but revert back to using variables in the larger readyto-go program code.) The base address is 888, and the value is decimal 10. Table 30.6 shows the first 16 binary numbers and the bit pattern that constitutes them. For most robotic applications where you use the parallel port to control motors, you ll need two data lines for each motor: one to turn the motor on and off and another to con-
UPC-A Supplement 2 Generator In None
Using Barcode generation for Excel Control to generate, create UPCA image in Microsoft Excel applications.
Creating Data Matrix 2d Barcode In Java
Using Barcode generation for Eclipse BIRT Control to generate, create Data Matrix ECC200 image in BIRT reports applications.
TABLE 30.6 DECIMAL
Make Matrix 2D Barcode In Java
Using Barcode creator for Java Control to generate, create Matrix Barcode image in Java applications.
Printing EAN / UCC - 13 In Objective-C
Using Barcode generation for iPad Control to generate, create GS1 128 image in iPad applications.
DECIMAL AND BINARY EQUIVALENTS (0 15 ONLY). BINARY
GS1 - 12 Generation In None
Using Barcode creator for Office Word Control to generate, create UCC - 12 image in Office Word applications.
Generate Data Matrix In Java
Using Barcode creation for Java Control to generate, create Data Matrix ECC200 image in Java applications.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
USING THE PORT TO OPERATE A ROBOT: THE BASICS
trol its direction. You can use the four bits in Table 30.6 to control the on/off state of the motors as well as their direction. For this you might use data lines 0, 1, 2, and 3 (pins 2, 3, 4, and 5, respectively, of the interface). Table 30.7 lists all the possible bit patterns for data lines 0 3. You can connect the motor relays to the pins in any order, but the table assumes the following:
I I I I
Data line 0 (bit 1) controls the On/Off relay for motor 1 Data line 1 (bit 2) controls the On/Off relay for motor 2 Data line 2 (bit 3) controls the Direction relay for motor 1 Data line 3 (bit 4) controls the Direction relay for motor 2
You should get into the habit of initializing the port at the beginning of the program by outputting decimal 0. That prevents the motors from energizing at random. The line of code for this is as follows:
TABLE 30.7
DATA BITS FOR CONTROLLING TWO MOTORS. MOTOR1 MOTOR 2 CONTROL (BIT 2) DIRECTION (BIT 4)
Copyright © OnBarcode.com . All rights reserved.