birt barcode open source Pin 4 Green R1 R2 16 VDD 14 VREF 10 SCL 9 SDA 5 A0 6 A1 7 A2 12 EXT 13 AGND 8 VSS R3 R4 in Font

Drawer Quick Response Code in Font Pin 4 Green R1 R2 16 VDD 14 VREF 10 SCL 9 SDA 5 A0 6 A1 7 A2 12 EXT 13 AGND 8 VSS R3 R4

Pin 4 Green R1 R2 16 VDD 14 VREF 10 SCL 9 SDA 5 A0 6 A1 7 A2 12 EXT 13 AGND 8 VSS R3 R4
Encode QR Code ISO/IEC18004 In None
Using Barcode creator for Font Control to generate, create QR Code JIS X 0510 image in Font applications.
www.OnBarcode.com
Barcode Creator In None
Using Barcode generation for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
NXT Pin 5 Yellow
Drawing Barcode In None
Using Barcode creation for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
ECC200 Encoder In None
Using Barcode generation for Font Control to generate, create ECC200 image in Font applications.
www.OnBarcode.com
Pin 6 Blue
Printing PDF417 In None
Using Barcode creation for Font Control to generate, create PDF417 image in Font applications.
www.OnBarcode.com
ANSI/AIM Code 39 Creation In None
Using Barcode drawer for Font Control to generate, create Code 39 Full ASCII image in Font applications.
www.OnBarcode.com
A0 15 1 AI0 2 AI1 3 AI2 AI3 4 R5 R6 GND CH0 CH1
Code 128C Creator In None
Using Barcode printer for Font Control to generate, create Code 128 Code Set B image in Font applications.
www.OnBarcode.com
Make USPS POSTNET Barcode In None
Using Barcode encoder for Font Control to generate, create USPS POSTNET Barcode image in Font applications.
www.OnBarcode.com
Pin 2 Black Pin 3 Red
QR Code JIS X 0510 Creator In None
Using Barcode creator for Software Control to generate, create QR Code image in Software applications.
www.OnBarcode.com
QR Code ISO/IEC18004 Scanner In Java
Using Barcode decoder for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Figure 13-31. Four Analog Ins circuit The bill of materials is in Table 13-5 and the step-by-step instructions are in Table 13-6. Table 13-5. Four Analog Ins Bill of Materials
Encode PDF-417 2d Barcode In Visual C#
Using Barcode creator for Visual Studio .NET Control to generate, create PDF-417 2d barcode image in VS .NET applications.
www.OnBarcode.com
GTIN - 128 Printer In Visual Studio .NET
Using Barcode encoder for .NET framework Control to generate, create EAN128 image in .NET applications.
www.OnBarcode.com
Component
European Article Number 13 Decoder In None
Using Barcode decoder for Software Control to read, scan read, scan image in Software applications.
www.OnBarcode.com
Barcode Generator In None
Using Barcode generator for Office Excel Control to generate, create Barcode image in Excel applications.
www.OnBarcode.com
U1 R1 and R2 R3 and R4 R5 and R6
Scan Barcode In Java
Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Matrix 2D Barcode Creation In .NET
Using Barcode creator for ASP.NET Control to generate, create Matrix image in ASP.NET applications.
www.OnBarcode.com
Part Number
Printing QR Code JIS X 0510 In None
Using Barcode drawer for Software Control to generate, create QR Code 2d barcode image in Software applications.
www.OnBarcode.com
Data Matrix ECC200 Recognizer In Java
Using Barcode decoder for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
PCF8591 82k 10k 10k
Encode Code 128C In None
Using Barcode creation for Software Control to generate, create ANSI/AIM Code 128 image in Software applications.
www.OnBarcode.com
Making Barcode In None
Using Barcode drawer for Excel Control to generate, create Barcode image in Excel applications.
www.OnBarcode.com
Description
I C Quad Analog Input 1/4 W 1% Film Resistors 1/4 W 1% Film Resistors Potentiometers
Digi-Key
568-1087-5-ND P82.0KCACT-ND P10.0KCACT-ND 3310C-001-103-ND
CHAPTER 13 I C BUS COMMUNICATION
Table 13-6. Four Analog Ins Component Placement
Component
U1 pin 1 R1 R2 R3 R4 R5 left center right R6 left center right J1 J2 J3 J4 J5 J6 J7 J8 J9 J10 J11 J12 J13 J14
Start
F3 X9 X10 D5 D3 J12 A14 X3 X5 D6 D7 J7 J8 J9 J10 I10 F12 F14 C14 C13 H5
A9 A10 G4 G3 J14 A12 A3 A5 G7 G8 Y7 Y8 Y9 Y10 I12 E12 E14 X16 G6 H13
CHAPTER 13 I C BUS COMMUNICATION
Table 13-6. Four Analog Ins Component Placement (continued)
Component
NXT Green White NXT Red Black NXT Blue Yellow
Start
X1 Y2 C10
H1 Y1 B9
Figure 13-32 shows the complete construction of the Four Analog Ins on a solderless breadboard. Although the potentiometers are shown attached directly to the breadboard, most likely they would be connected on long wires to measure the angle of a joint some distance from the circuit.
Figure 13-32. Four Analog Ins on solderless breadboard Using the PCF8591 in a NXT-G program requires importing the custom 8591 block. We prefer this PCF8591 block because it is simpler to use and seems more reliable than the one from Mindsensors. As you can see in Figure 13-33, the 8591 block has inputs for port number, I2C address, and analog output value. The values for the four channels of A/D values are displayed using the Display Value MyBlock developed in 2.
CHAPTER 13 I C BUS COMMUNICATION
Figure 13-33. Read4 NXT-G program with 8591 block Without anything connected, channels 0 and 1 will read 255, as shown in Figure 13-34. You need to customize this design for your particular needs. You might want all potentiometer inputs, or you might want to connect four passive-style sensors. In 14, we ll show you how to combine the Four Analog Ins project with a graphics program to make a Pong video game.
Figure 13-34. Read4 NXT-G program with 8591 block The Read4 NXC program shown in Listing 13-6 reads all four channels and just displays their values on the NXT display. This is a handy program for debugging PCF8591 sensors. Only the Auto increment bit is set in the control byte (hexadecimal 04) so it is in input Mode 0. ReadBuf[0] contains an old conversion value and is not displayed.
CHAPTER 13 I C BUS COMMUNICATION
Listing 13-6. Read4 program #define port S1 // sensor port 1 #define I2CAddr8591 0x90 // PCF8591 address byte WriteBuf[] = {I2CAddr8591, 0x04}; // write buffer byte ReadBuf[]; // read buffer int RdCnt=5; // read 5 bytes task main(){ SetSensorLowspeed(port); // make port I2C while(true){ // Write config byte and read back 5 bytes I2CBytes(port, WriteBuf, RdCnt, ReadBuf); NumOut(0,24,ReadBuf[1],true); // Chan 0 NumOut(0,16,ReadBuf[2]); // Chan 1 NumOut(0,8,ReadBuf[3]); // Chan 2 NumOut(0,0,ReadBuf[4]); // Chan 3 } }
2-D Light Sensor
Way back in 5 you learned how to build a light-seeking robot called the Braitenberg Vehicle that required two separate Light Sensors and two NXT sensor ports. Then in 8 we combined two Light Sensors into a single Differential Light Sensor that only needed a one NXT port. Now let s see how to use the four analog inputs of the PCF8591 to build a light-seeking vehicle that will move toward bright light regardless of its direction. Figure 13-35 shows just the part of the circuit with four Light Dependent Resistors (LDRs) and their pull-up resistors. The rest of the circuit is built like Figure 13-31 with R3-R6 removed. The four LDRs share a common connection to the AGND input of the PCF8591 and, through 10k pull-ups, to VREF.
VREF 10K IN0 IN1 IN2 IN3 F B L R 10K 10K 10K
AGND LDRs CdS Photocells
Figure 13-35. 2-D Light Sensor Circuit for PCF8591
CHAPTER 13 I C BUS COMMUNICATION
For simplicity, we built our 2-D Light Sensor using the Mindsensors PCF8591 prototype board. You can find out more about this board in Appendix A. Long pieces of wire insulation have been slipped over the leads of the LDRs in Figure 13-36 to keep them from accidentally connecting to each other. Part of the prototyping area of the board was used to attach the four pull-up resistors. It is critical that you get the input channel and physical direction of the LDRs correct for the light seeker to work.
Figure 13-36. LDRs on Mindsensors PCF8591 prototype board Figure 13-37 shows the 2-D sensor attached on top of the Quick Start Vehicle to make a light-seeking robot.
Copyright © OnBarcode.com . All rights reserved.