- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
birt barcode open source Building a Two-Switch Input in Font
Building a Two-Switch Input Generate Denso QR Bar Code In None Using Barcode creation for Font Control to generate, create QR-Code image in Font applications. www.OnBarcode.comDenso QR Bar Code Generator In None Using Barcode creator for Font Control to generate, create QR image in Font applications. www.OnBarcode.comBuilding the two-switch input is easy. In step 1, shown in Figure 5-46, solder the resistors to the switch and interconnect wires. Remember to have a short piece of shrink tubing to slide over the terminal without a resistor. Shrink the short piece of tubing and then slide a long piece of tubing over the wire to cover all the connections. Naturally your switches don t have to be right next to each other like the ones in the photograph. They could be on the front and back of a robot to detect that it has driven or backed into something. Draw PDF417 In None Using Barcode generator for Font Control to generate, create PDF 417 image in Font applications. www.OnBarcode.comUCC - 12 Generator In None Using Barcode creation for Font Control to generate, create EAN / UCC - 14 image in Font applications. www.OnBarcode.comFigure 5-46. Two-switch step 1 After soldering, slide the heat shrink tubing up to the switch and shrink it with a hair dryer. It should look like Figure 5-47. Create European Article Number 13 In None Using Barcode maker for Font Control to generate, create GS1 - 13 image in Font applications. www.OnBarcode.comData Matrix Creator In None Using Barcode printer for Font Control to generate, create Data Matrix ECC200 image in Font applications. www.OnBarcode.comCHAPTER 5 RESISTIVE SENSORS
Print ANSI/AIM Code 128 In None Using Barcode maker for Font Control to generate, create Code 128A image in Font applications. www.OnBarcode.comOneCode Maker In None Using Barcode generator for Font Control to generate, create OneCode image in Font applications. www.OnBarcode.comFigure 5-47. Two-switch step 2 Finally, shrink a piece of tubing over all the connections and resistors. Your finished two-switch input will look like Figure 5-48. Painting Denso QR Bar Code In None Using Barcode maker for Font Control to generate, create QR Code ISO/IEC18004 image in Font applications. www.OnBarcode.comPaint QR-Code In None Using Barcode generation for Office Excel Control to generate, create QR-Code image in Microsoft Excel applications. www.OnBarcode.comFigure 5-48. Two-switch step 3
Creating 1D Barcode In Java Using Barcode encoder for Java Control to generate, create 1D image in Java applications. www.OnBarcode.comDecoding ECC200 In Visual C# Using Barcode scanner for VS .NET Control to read, scan read, scan image in .NET framework applications. www.OnBarcode.comProgramming a Two-Switch Input
Barcode Reader In .NET Using Barcode reader for .NET Control to read, scan read, scan image in .NET applications. www.OnBarcode.comCreate Code39 In Java Using Barcode creation for BIRT Control to generate, create Code 39 Full ASCII image in BIRT reports applications. www.OnBarcode.comA NXT-G My Block (shown in Figure 5-49) sorts out the four switch combinations by comparing the incoming Raw value with levels that are in between the switch states. The state of SW2 is easy to decode because it must be on if the Raw value is less than 371. Switch 1 requires checking to see if the Raw value is in the range between 460 and 371, where it is on by itself; it can also be on with SW2, which makes the Raw value less than 275. Code 3 Of 9 Creator In VS .NET Using Barcode encoder for ASP.NET Control to generate, create USS Code 39 image in ASP.NET applications. www.OnBarcode.comPaint ECC200 In Java Using Barcode printer for Android Control to generate, create Data Matrix ECC200 image in Android applications. www.OnBarcode.comCHAPTER 5 RESISTIVE SENSORS
Draw European Article Number 13 In Visual Basic .NET Using Barcode encoder for .NET framework Control to generate, create EAN-13 Supplement 5 image in .NET applications. www.OnBarcode.comCode 128B Generator In C#.NET Using Barcode generator for .NET framework Control to generate, create Code 128A image in .NET framework applications. www.OnBarcode.comFigure 5-49. Two-switch decode My Block It s a good idea to run the test program shown in Figure 5-50 with your two-switch input to make sure that the values you re getting decode properly. The program displays the Raw value and the decoded state of the two switches. You might need to adjust the threshold levels to compensate for the particular resistor values you used. EAN 13 Generation In .NET Framework Using Barcode generator for Reporting Service Control to generate, create EAN-13 Supplement 5 image in Reporting Service applications. www.OnBarcode.comQR Code ISO/IEC18004 Encoder In None Using Barcode printer for Software Control to generate, create QR-Code image in Software applications. www.OnBarcode.comFigure 5-50. Two-switch test program
CHAPTER 6
Potentiometer Sensors
A potentiometer, or pot for short, doesn t change in resistance with temperature like a thermistor, or light level like a CdS light-dependent resistor. It changes with the rotation of a mechanical shaft. You re probably already familiar with the device because it s commonly used as the volume control on audio equipment. Rotating the shaft changes the resistance between the center and outer two terminals. It s a kind of self-contained voltage divider. Usually the shaft can rotate only 270 degrees, but multiturn versions are available. Figure 6-1 shows several examples of potentiometers. Figure 6-1. Examples of potentiometers
Connecting to the Pot
A potentiometer is also a passive-type sensor, and is connected to the NXT using the same two connections you used for the contact and resistive sensors from s 4 and 5. Connecting the NXT to the left and center terminals creates an angle sensor that increases in resistance with clockwise rotation, as shown in Figure 6-2. Connecting to the center and right terminals makes a counterclockwise sensor. In either case, it s a good idea to connect the remaining outer terminal to the center terminal. CHAPTER 6 POTENTIOMETER SENSORS
Figure 6-2. Connections for clockwise and counterclockwise rotation
Resistance Selection
Potentiometers come in many different full-scale resistance values and tapers. Linear taper means the resistance changes evenly with angle, and that s what you re looking for. You can write an equation for the resistance, where A is the angle in degrees and Rpot is the full-scale resistance. Plugging that equation into the one you already have for Raw values leads to an equation that tells you what Raw value you ll get at any angle. A Rpot 270
Raw =
1023 2,700,000 +1 A Rpot
Not surprisingly, the Raw value doesn t change linearly with angle. The plot in Figure 6-3 shows the results you get for three Rpot values. Clearly the Raw value for the 50k changes the most in the first 90 degrees of rotation, but after that it levels off. In the range from 90 to 180 degrees, the 20k pot changes the most and is the best choice for applications with up to 180 degrees of rotation. For full 270-degree rotation, the 10k is the best because it has the most change in the 180-to-270 degree range.
|
|