tailieunhanh - Practical Arduino Cool Projects for Open Source Hardware- P10

Practical Arduino Cool Projects for Open Source Hardware- P10: A schematic or circuit diagram is a diagram that describes the interconnections in an electrical or electronic device. In the projects presented in Practical Arduino, we’ve taken the approach of providing both a photograph and/or line drawing of the completed device along with a schematic. While learning to read schematics takes a modest investment of your time, it will prove useful time and time again as you develop your projects. With that in mind, we present a quick how-to in this section | CHAPTER 5 PS 2 KEYBOARD OR MOUSE INPUT With both sockets connected up the end result should look something like Figure 5-6. Figure 5-6. PS 2 sockets wired to power and data on the shield That s it. The shield is done. Mount it on your Arduino plug in a keyboard or mouse as appropriate and proceed to the software section. PS 2 Extension Cable A simple alternative to mounting sockets on the shield is to cut one end off a PS 2 extension cable and attach it. Before you do any cutting plug your PS 2 extension cable into your keyboard or mouse just to make sure you chop off the correct end. With the cable plugged in cut off the connector at the other end to leave you with a nice long lead with a PS 2 socket attached. Then strip back about three or four centimeters of the outer insulation and you should be left with a set of four or possibly six color-coded wires plus a foil or braid shield. Even if there are more wires inside the cable there are actually only four that you need to care about ground 5V DATA and CLOCK. You can ignore the others because we won t be using them. Don t be fooled by the color-coding on the wires though because the colors might not be what you expect them to be. For example in the PS 2 extension cable we used for this project the red wire is the ground connection quite deceiving if you re the trusting type who assumes red always means positive In our case the color codes were as shown in Table 5-2. 69 CHAPTER 5 PS 2 KEYBOARD OR MOUSE INPUT Table 5-2. Typical color codes in PS 2 extension cable. Varies between manufacturers. Pin Purpose Color 3 Ground Red 4 5V Green 1 DATA Orange 5 CLOCK Brown To identify which wire is which you can use a multimeter as a continuity tester by setting it to a low Ohms range with one multimeter probe connected to one of the wires and the other inserted into each of the socket connections in turn to find which pin that wire connects to. If your multimeter probe won t fit into the tiny holes in the PS 2 connector you