Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 320 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
320
Dung lượng
7,94 MB
Nội dung
[...]... project First, we need to install the Arduino IDE To do this, go to www .Arduino. cc/en/Main/Software The Arduino IDE will work with Windows Vista or 7, Mac OS X, and Linux systems After the Arduino IDE is downloaded to your desktop, it will be in a zipped format, so unzip the Arduino- 0022 file to your desktop The Arduino IDE is now installed Now that you have the Arduino IDE installed on your computer,... blinking LED project • • LED • 10 Arduino 9V battery CHAPTER 1 THE PROCESS OF ARDUINOENGINEERING • 9V connector To set up the hardware, we need to connect the LED to digital pin 13 and ground on the Arduino( see Figure 1-11), as illustrated in the schematic shown in Figure 1-12 Figure 1-11 The hardware setup for the Blinking LED project 11 CHAPTER 1 THE PROCESS OF ARDUINOENGINEERING Figure 1-12 A schematic... this, open the Arduino IDE, and go to Tools Serial port; select the serial port your Arduino is connected to Next, select Tools Boards, and select the Arduino board you are using (this book uses the Arduino Duemilanove Atmega328) Once your hardware is configured, it is time to write the software Writing the Software Now, let’s consider the software we need to write This part of the engineering process... calculator: This allows you to do various calculations (Ohm’s Law, voltage divider, etc.) CHAPTER 1 THE PROCESS OF ARDUINOENGINEERING Figure 1-9 Additional Tools from left to right: multimeter, needle-nose pliers, wire clippers (top), wire stripper (bottom) Understanding the Engineering Process The engineering process is very useful in making your designs more efficient, streamlined, and comprehensible The... complicated, and the engineering process will become even more necessary to make sure our code is efficient, streamlined, and comprehensible Summary In this chapter, you learned the different pieces of hardware and various tools such as: The Arduino, Arduino Shields, Multimeter, and needle-nose pliers; just to name a few that will be used throughout this book We then went over the engineering process,... All Arduino programs must have two main components to work properly—setup() and loop()—and they are implemented like this: // Basic Arduino Program void setup() { // Set up I/Os here } void loop() { // Do something } setup() is used to set up your I/O ports such as LEDs, sensors, motors, and serial ports Careful setup is important because in order to use the pins on the Arduino, we need to tell Arduino. .. the best results, or you can hook a 9V battery to the power of the motor shield and the Arduino 30 CHAPTER 3 ROBOT ENGINEERING REQUIREMENTS: CONTROLLING MOTION Figure 3-4 Terminal blocks added to the motor shield Figure 3-5 The switch is connected to digital pin 10 and ground on the Arduino 31 CHAPTER 3 ROBOT ENGINEERING REQUIREMENTS: CONTROLLING MOTION Figure 3-6 The motor is connected to the motor... shield, and the switch is connected to digital pin 10 and ground on the Arduino 32 CHAPTER 3 ROBOT ENGINEERING REQUIREMENTS: CONTROLLING MOTION Figure 3-7 The schematic for this project Now that you have connected the push button and motor, you need to connect your Arduino to your computer so that the software can be uploaded to the Arduino We will write the program for this project in the next section... at 100ms intervals Creating the Requirements Document Based on the client’s needs and your proposed solution, the following is a very simple requirements document: • Hardware • Arduino • LED 9 CHAPTER 1 THE PROCESS OF ARDUINOENGINEERING • • 9V battery connector • • 9V battery 22ohm resistor Software • A program that blinks an LED at 100ms intervals Mind you, this is a very simple example, but we will... the hardware, configuring the hardware, writing the software, debugging the Arduino software, troubleshooting the hardware, and finished prototype I also defined a few new terms that will help you understand the engineering process, and you learned the differences between logical and syntax errors 14 CHAPTER 2 Understanding the Arduino Software In this chapter, we will discuss the various programming .
Chapter 1: The Process of Arduino Engineering 1
Chapter 2: Understanding the Arduino Software 15
Chapter 3: Robot Engineering Requirements: Controlling. Perception: Object Detection with the Arduino 165
Chapter 8: Mature Arduino Engineering: Making an Alarm System Using the
Arduino 197
Chapter 9: Error