tailieunhanh - Practical Arduino Cool Projects for Open Source Hardware- P37
Practical Arduino Cool Projects for Open Source Hardware- P37: 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 15 VEHICLE TELEMETRY PLATFORM that OBDuinoMega should be able to be built in two forms one with the original functionality and still able to fit into an ATMega328 and one with extended functionality that requires the ATMega1280 CPU found in an Arduino Mega. The use of compile-time switches allows the same codebase to be built for both targets with additional functionality included or excluded depending on settings in the main file. Depending on the options you use there are two libraries you might need to install both written by Mikal Hart. TinyGPS is a minimal NMEA parser that takes a raw stream from a GPS module and extracts various useful parameters from it. It s designed to be lightweight by avoiding floating-point math where possible and ignoring many of the NMEA fields that aren t likely to be interesting. TinyGPS makes interfacing with serial GPS modules such as the Locosys LS20031 amazingly easy. TinyGPS is available for download from the Mikal s Arduiniana web site libraries tinygps so grab it and extract it into the libraries directory inside your sketchbook directory. PString is a very small class that extends the Print class already included in Arduino and allows you to print data into a buffer . It s extremely handy because you can use regular syntax that you re already familiar with from functions such as and use it to format and store data for later access. It s used in OBDuinoMega to manage a buffer containing data collated from multiple sources prior to being written to the USB memory stick all at once. It s available at libraries PString . The main program file starts with a whole series of compilation modifiers. These change the way the project is built allowing you to include or exclude different features to suit your requirements as discussed previously. This also helps keep the resulting hex file as small as possible but remember that some features are dependent on others. The
đang nạp các trang xem trước