1. Trang chủ
  2. » Công Nghệ Thông Tin

Programming the intel edison getting started with processing and python

242 173 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Title Page

  • Copyright Page

  • Dedication

  • Contents at a Glance

  • Contents

  • Preface

  • 1 Introduction

    • The Edison Computing Module

    • Intel Arduino Development Board

    • Intel Edison Breakout Board

    • Sparkfun Block for Intel Edison–Console

    • Summary

  • 2 Getting Started with the Intel Edison Arduino Board

    • Intel Edison Arduino IDE

    • Powering the Arduino Development Board

    • USB Communications

    • Blink Sketch

    • Modifying the Blink Sketch

    • Summary

  • 3 Working with Processing and the Intel Arduino IDE

    • The Processing Language and the Intel Edison Arduino IDE

    • Processing Language Basics

      • Input and Output Statements

      • Data Variables

    • Average Voltage Measurement Sketch

    • Switch Demo Sketch

    • Mini-Servo Sketch Example

    • Ping Sensor Sketch

    • Summary

  • 4 Edison-Controlled Robotic Car

    • BOE-BOT Car

    • How an Analog Servo Works

    • Continuous Rotation ⠀䌀刀) Servos

    • Servo1 Sketch

    • Autonomous Operation

    • Operating the Robot Car

    • Summary

  • 5 Connecting to Edison Linux with the Command-Line Prompt

    • Intel Edison Breakout Board

    • Setting Up Your First USB Communications Session

      • FTDI Drivers

      • Windows Drivers

    • Connecting to the Client Computer

    • Updating/Upgrading the Edison Firmware

    • configure_edison Application

    • Date and Time

    • Web Server

    • Python

    • C/C++

    • Node.js

    • Summary

  • 6 Debian Linux and Python Basics

    • How to Install the Debian Linux Distribution

      • Step-by-Step Edison Debian Load Procedure

    • WiFi Setup

    • SSH

    • Basic Python

    • Python Help

    • Data Types, Variables, and Constants

    • User-Defined Functions

    • Interpolated Sensor Measurements

    • Summary

  • 7 Python Classes, Methods, and the libmraa Library

    • Basic OO Concepts

    • The Class

    • Installing the libmraa Library

      • mraa Version Check

      • Blink Program

      • Servo Control Program

      • CR Servo Control Program

      • Analog Motor Control Program

    • EMC Class Implementations

    • Summary

  • 8 Hardware Interfaces

    • Serial Protocols

      • UART Serial Protocol

      • I2C Serial Protocol

      • SPI Serial Protocol

      • I2S Serial Protocol

    • Parallel Protocols

      • GPIO

      • SD Card Interface

      • Clock Outputs

    • Summary

  • 9 Web Server and Database

    • LAMP

      • Apache Web Server and the PHP Scripting Language

    • MySQL Database Installation

      • Adding a New User to a MySQL Database

      • Python Database Connection

    • Home Temperature Measurement System

      • TMP36 Temperature Sensor

      • Initial Test

      • Multiple Sensor System

      • Multiple Sensor Software

    • Temperature Database

      • Inserting Data into a MySQL Database Using a Program

      • Database Access Using a Web Browser

      • Narrowing the Database Reports

    • Summary

  • 10 Wearables

    • Sparkfun Console Module

    • Stackable Architecture

    • Chapter Project

      • Battery Module

      • 9DOF Module

    • The Project Software

      • sudo

    • The Project Stack

      • Initial Project Stack Test

      • Battery Operations

    • Paho and Eclipse.org

      • MQTT

      • Quality of Service ⠀儀漀匀)

      • Wills

      • Reconnecting

    • Edison MQTT Publisher Client

      • Auto Start

      • MQTT Brokers

    • MQTT Subscriber Clients

      • Mac MQTT Subscriber Client

      • Android Smartphone Subscriber Client

    • Summary

  • Index

Nội dung

About the Author Donald Norris has a degree in electrical engineering and an MBA specializing in production management He is currently teaching undergrad and grad courses in the IT subject area at Southern New Hampshire University He has also created and taught several robotics courses there He has over 30 years of teaching experience as an adjunct professor at a variety of colleges and universities Mr Norris retired from civilian government service with the U.S Navy, where he specialized in acoustics related to nuclear submarines and associated advanced digital signal processing Since then, he has spent more than 20 years as a professional software developer using C, C#, C + +, Python, Node.js, and Java, as well as years as a certified IT security consultant Mr Norris started a consultancy, Norris Embedded Software Solutions (dba NESS LLC), which specializes in developing application solutions using microprocessors and microcontrollers He likes to think of himself as a perpetual hobbyist and geek and is always trying out new approaches and outof-the-box experiments He is a licensed private pilot, photography buff, amateur radio operator, avid runner, and, last but very important, a grandfather to a brand new baby girl—here’s to you, Evangeline Copyright © 2016 by McGraw-Hill Education All rights reserved Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a data base or retrieval system, without the prior written permission of the publisher ISBN: 978-1-25-958789-4 MHID: 1-25-958789-4 The material in this eBook also appears in the print version of this title: ISBN: 978-1-25958833-4, MHID: 1-25-958833-5 eBook conversion by codeMantra Version 1.0 All trademarks are trademarks of their respective owners Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark Where such designations appear in this book, they have been printed with initial caps McGraw-Hill Education eBooks are available at special quantity discounts to use as premiums and sales promotions or for use in corporate training programs To contact a representative, please visit the Contact Us page at www.mhprofessional.com Information has been obtained by McGraw-Hill Education from sources believed to be reliable However, because of the possibility of human or mechanical error by our sources, McGraw-Hill Education, or others, McGraw-Hill Education does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from the use of such information TERMS OF USE This is a copyrighted work and McGraw-Hill Education and its licensors reserve all rights in and to the work Use of this work is subject to these terms Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill Education’s prior consent You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited Your right to use the work may be terminated if you fail to comply with these terms THE WORK IS PROVIDED “AS IS.” McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE McGraw-Hill Education and its licensors not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free Neither McGraw-Hill Education nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom McGraw-Hill Education has no responsibility for the content of any information accessed through the work Under no circumstances shall McGraw-Hill Education and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise This book is dedicated to Linda Norris, who is a kind, loving, and generous person, and mother to Shauna, Heath, and Derek She is also Mimi to grandchildren Hudson and Evangeline CONTENTS AT A GLANCE Introduction Getting Started with the Intel Edison Arduino Board Working with Processing and the Intel Arduino IDE Edison-Controlled Robotic Car Connecting to Edison Linux with the Command-Line Prompt Debian Linux and Python Basics Python Classes, Methods, and the libmraa Library Hardware Interfaces Web Server and Database 10 Index Wearables CONTENTS Preface Introduction The Edison Computing Module Intel Arduino Development Board Intel Edison Breakout Board Sparkfun Block for Intel Edison–Console Summary Getting Started with the Intel Edison Arduino Board Intel Edison Arduino IDE Powering the Arduino Development Board USB Communications Blink Sketch Modifying the Blink Sketch Summary Working with Processing and the Intel Arduino IDE The Processing Language and the Intel Edison Arduino IDE Processing Language Basics Input and Output Statements Data Variables Average Voltage Measurement Sketch Switch Demo Sketch Mini-Servo Sketch Example Ping Sensor Sketch Summary Edison-Controlled Robotic Car BOE-BOT Car How an Analog Servo Works Continuous Rotation (CR) Servos Servo1 Sketch Autonomous Operation Operating the Robot Car Summary Connecting to Edison Linux with the Command-Line Prompt Intel Edison Breakout Board Setting Up Your First USB Communications Session FTDI Drivers Windows Drivers Connecting to the Client Computer Updating/Upgrading the Edison Firmware configure_edison Application Date and Time Web Server Python C/C++ Node.js Summary Debian Linux and Python Basics How to Install the Debian Linux Distribution Step-by-Step Edison Debian Load Procedure WiFi Setup SSH Basic Python Python Help Data Types, Variables, and Constants User-Defined Functions Interpolated Sensor Measurements Summary Python Classes, Methods, and the libmraa Library Basic OO Concepts The Class Installing the libmraa Library mraa Version Check Blink Program Servo Control Program CR Servo Control Program Analog Motor Control Program EMC Class Implementations Summary Hardware Interfaces Serial Protocols UART Serial Protocol I2C Serial Protocol SPI Serial Protocol I2S Serial Protocol Parallel Protocols GPIO SD Card Interface Clock Outputs Summary Web Server and Database LAMP Apache Web Server and the PHP Scripting Language MySQL Database Installation Adding a New User to a MySQL Database Python Database Connection Home Temperature Measurement System TMP36 Temperature Sensor Initial Test Multiple Sensor System Multiple Sensor Software Temperature Database Inserting Data into a MySQL Database Using a Program Database Access Using a Web Browser Narrowing the Database Reports Summary 10 Wearables Sparkfun Console Module Stackable Architecture Chapter Project Battery Module 9DOF Module for wearables, 193–194, 200–201 BCM43340 chip (Broadcom), 1–2 Bit clock, 139 “Bit-banging,” 117, 138, 161 BLE (Bluetooth Low Energy) wireless communication, Blink program: libmraa library, 103–104 Node.js version, 74–75 Blink sketch, 16–20 modifying, 18–20 switch demo (Blink 2) sketch modified from, 31–34 Bluetooth Low Energy (BLE) wireless communication, BMP085 (Bosch Corp), 121–130 Adafruit class version, 123 and I2C, 121–122 and ic detect utility, 130–131 physical test setup, 123 test class, 129–130 test software, 122–130 Board of Education Robot (BOE-BOT) kit, 43 (See also Robotic car) Bosch Corp BMP085 [see BMP085 (Bosch Corp)] Breakout board (see Intel Edison Breakout Board) Broadcom BCM43340 chip, 1–2 Brushed electric motor (analog servo): control program, 108–112 inner workings of, 46, 47 Bus network, 120 (See also I2C serial protocol) C Calibration: interpolated sensor measurements, 93–95 temperature sensor, 91–93 Call back methods, 210 C/C++, 72 brackets defining blocks of code in, 85 Python based on, 88 RTIMUlib for, 197 using mraa with, 102 CDC (Composite Device Class), 65 Child classes, 100 Classes, 98–101 BMP085, 122–129 child, 100 class definitions file, 112–116 parent, 99 purpose of, 98 Clean session flag, 203 Client computer: connecting to, 65–67 installing FTDI drivers for, 64–65 installing Windows drivers for, 65 (See also MQTT publisher client; MQTT subscriber clients) Client ID, 203, 204 Clock outputs, 142–144 Comments: in Python, 85 in sketches or programs, 18–19 Compiler directive symbol (#), 36, 85 Composite Device Class (CDC), 65 Conditional (selection) control, 24, 25 Configure_edison application, 68–69 Connecting to client computer, 65–67, 203 Connecting to Edison module, 63–75 breakout board functionality, 63–64 C and C++ languages, 72 configure_edison application, 68–69 connecting to client computer, 65–67 date and time, 69–70 installing FTDI drivers, 64–65 installing Windows drivers, 65 Node.js language, 73–75 setting up USB communications, 64–65 starting Python, 71–72 starting web server, 70–71 updating/upgrading Edison firmware, 67 Connectors, 3–4 on Arduino Development Board, 13–14 for breakout board, 63–64 Hirose 70-pin, 3–4 RJ45, 166–170 of Sparkfun console module, 191 USB, 13–15 Constants (Python), 90 Constraints, for temperature database, 186–188 Continuous rotation (CR) servos: EMC design for, 99 mraa-based control program, 106–108 robotic car, 51–54 Control PCB (analog servo), 46, 47 Coprocessor, CR servos (see Continuous rotation servos) csv (comma separated variable) files, 94 D Data line, 139 Data types: in Processing, 27 Python, 88–90 Data variables: Processing language, 27–28 Python, 88–90 Database(s): for home temperature measurement system, 173–188 MySQL (see MySQL database) for sensor-driven websites, 150 structure of, 151 (See also LAMP installation) Date, 69–70 Deadband, 51 Debian Linux, 77 ensuring current status of, 146 installing, 77–81 I2C tools and, 121 for LAMP installation, 145 nano text editor, 81–82 Poky Linux vs., 77 and SPI interface, 132 WiFi configuration with, 81–83 Degrees of freedom (DOF), 194, 195 Deters, Jens, 210 Dev board (see Intel Arduino Development Board) Development boards: Edison Breakout Board, 6–7 Intel Arduino, 4–6 Sparkfun Block, 7–9 DFU (Device Firmware Upgrade), 65 DOF (degrees of freedom), 194, 195 E Eclipse Foundation, 209 Eclipse.org, 201 Edison (see Intel Edison) Edison Hardware Guide, 139 Electronic motor controller (EMC): analog motor control program, 108–112 attributes, 98, 113–114 class implementations, 112–116 classes, 98–101 CR servo control program, 106–108 interface of microcontroller to, 100–101 methods, 98–99, 114 servo control program, 104–106 Emulations, 24, 41, 42 Eurotech, 201 External antenna connector, F Feedback potentiometer (analog servo), 46, 47, 52 Firmware, Edison: configure_edison application, 68–79 date and time, 69–70 starting web server, 70–71 updating/upgrading, 67 Flash memory, Flow of control, 24 4-wire serial bus, 131 [See also SPI (Serial Peripheral Interface) protocol] FTDI drivers, installing, 64–65 Functions (Python): to improve efficiency and readability, 90–91 user-defined, 91–93 G G (unit of gravitation), 195 Galileo (Intel), 101 Gauss (G), 195 gcc, 72 Gear set (analog servo), 46, 47 General-purpose input/output pins (see GPIO pins) Getters, 115 GitHub, 197 GPIO line, for EMCs, 101 GPIO (general-purpose input/output) pins, controlling, 140 and emulation, 24 functions of, 141–142 parallel protocols, 140–142 pinout diagram, 25–26 H Hardware interfaces, 117–144 clock outputs, 142–144 I2C serial protocol, 120–131 I2S serial protocol, 139–140 parallel protocols, 140–144 SD card, 142, 143 serial protocols, 117–140 SPI serial protocol, 131–139 UART serial protocol, 118–120 USB 2.0 interface, 117 Headless operation, 83 “Hello World!” program, 72, 73, 146 Help feature (Python), 86–88 High frequency clock signal, 143–144 Hirose connectors: 70-pin, 3–4 for Edison Breakout Board, mounting plug for Arduino Development Board, 5–6 on Sparkfun base module, 191 for Sparkfun Block, Hitec electronics board, 48 Home temperature measurement system, 159–188 accessing database using web browser, 184–186 database, 173–188 initial test, 161–166 inserting data into MySQL database using program, 176–184 multiple sensor software, 170–173 multiple sensor system, 166–170 narrowing database reports, 186–188 TMP36 temperature sensor, 159–162 HTTP bridge (MQTT brokers), 209–210 Hymel, Shawn, 78 I IBM Pervasive software group, 201 ic detect utility, 130 IDE (see Integrated development environment) IMU (LSM9DS0 inertial measurement unit, ST Microelectronics), 194–195 Input statements (Processing language), 25–27 “Installing libmraa on Ubilinux for Edison,” 101 Integrated development environment (IDE): Arduino (see Arduino integrated development environment) Intel, 11, 23–24 Integrated Interchip Sound (I2S) serial protocol, 139–140 Intel, 130 Intel Arduino Development Board (dev board), 4–6, 11–21 Arduino IDE for, 11–13 Blink sketch, 16–20 in home temperature measurement system, 169–170 modifying Blink sketch, 18–20 powering, 13–14 SD card holder, 142 special-function GPIO pins on, 140 USB communications, 14–15 and using real Arduinos vs., 55 Intel dual-core Silvermont Atom processor, Intel Edison, 1–10 Arduino Development Board, 4–6 Breakout Board, 6–7 Broadcom chip, 1–2 connector, 3–4 memory, processor and coprocessor, Sparkfun Block, 7–9 topside components, 1–2 (See also specific topics) Intel Edison Arduino IDE, 11–13 and Processing language, 23–24 versions of, 11, 12 Intel Edison Breakout Board, 6–7 connecting to Edison module on (see Connecting to Edison module) with Edison mounted on, 63, 64 functionality of, 63–64 Intel Galileo, 101 Interactive mode (interpreted mode): Node.js, 73 Python, 84 Inter-Integrated Circuit interface (see I2C serial protocol) Internet of Things (IoT) Projects, 149, 201 Interpolated sensor measurements (Python), 93–95 Interpreted mode, 73, 84 IoT (Internet of Things) Projects, 149, 201 I2C serial protocol, 120–131 and BMP085 sensor, 121–122 BMP085 test software, 122–130 and SMBus utilities tests, 130–131 software, 121 I2S serial protocol, 139–140 J Java: MQTT library, 204 “will” concept in, 203 L LAMP installation, 145 Apache web server, 146–149 for home temperature measurement (see Home temperature measurement system) MySQL database installation, 149–158 PHP scripting language, 145–149 Python database connection, 157–158 temperature database, 173–188 Learn.Adafruit.com, 136 Learn.Sparkfun.com, 78, 101 libmraa library, 101–112 analog motor control program, 108–112 blink program, 103–104 CR servo control program, 106–108 mraa version check, 103 servo control program, 104–106 Light, Roger, 209 Linux: connecting to Edison with, 64 loading Debian on, 78 MQTT client for, 210 WiFi access-point mode support, (See also Debian Linux; Poky Linux) Lists, in Python, 94 “Loading the Debian (Ubilinux) on the Edison” (Shawn Hymel), 78 Loopback test program, for SPI interface, 132–133 Looping, 24, 25 LSM9DS0 inertial measurement unit (IMU, ST Microelectronics), 194–195 M Machine to Machine (M2M), 201 Macs: connecting to Edison with, 64 loading Debian on, 78 MQTT subscriber clients, 210–212 Magnetic flux density, 195 MCP3008 (Microchip): connecting to dev board, 134–135 interfacing TMP36 sensors to, 161–163 testing with Edison, 135–139 Mechanical stop (servos), 51–52 Memory, Message Queuing Telemetry Transport (see MQTT) Methods (OO), 98 M51660L chip (Mitsubishi), 53, 58–59 Micro SD card (Sparkfun), 142, 143 Microchip MCP3008 [see MCP3008 (Microchip)] Mini-servo sketch, 34–38 Mitsubishi M51660L chip, 53, 58–59 Mosquito project, 209 Movement monitor, wearable, 193–213 battery module, 193–194 MQTT message protocol, 201–204 MQTT publisher client, 204–210 MQTT subscriber clients, 210–213 9DOF module, 194, 195, 198–199 Paho, 201 project stack, 198–201 software, 196–198 MQTT, 201–204 Quality of Service, 202–203 reconnecting with, 203–204 wills, 203 MQTT Example app, 212–213 MQTT publisher client, 201, 202, 204–210 auto start, 208 MQTT brokers, 202, 205–207, 209–210 MQTT subscriber clients, 201, 202, 210–213 Android smartphone, 212–213 Mac, 210–212 mqttfx.jfx4ee.org, 210 mraa library, 74 and Adafruit BMP085 class version, 123 controlling GPIO pins with, 140 linking to Python, 102–103 version check, 103 (See also libmraa library) M2M (Machine to Machine), 201 Multidrop network, 120 (See also I2C serial protocol) Multiple sensor software, for home temperature measurement system, 170–173 Multiple sensor system, for home temperature measurement system, 166–170 Mutators, 115 MySQL database: accessing, using web browser, 184–186 adding new user to, 156–157 commands in MySQL, 152 creating temperature database, 151–154 deleting data, 155 inserting data using a program, 176–184 installation, 149–158 narrowing reports from, 186–188 Python database connection, 157–158 N nano, 81–82, 148, 200 9DOF (nine degrees of freedom) module, 194, 195, 198–199 Node.js, 73 brackets defining blocks of code in, 85 examples, 73–75 NXP Semiconductors, 121, 139 NXP UDA 1380, 139 O Object-orientation (OO), 97–98 classes, 98–101 EMC class implementations, 112–116 key elements of, 97 Orthogonal (term), 195 Output statements (Processing language), 25–27 P Paho, 201 (See also MQTT) Parallax Board of Education Robot (BOE-BOT) kit, 43 (See also Robotic car) Parallel protocols, 140–144 clock outputs, 142–144 GPIO, 140–142 SD card interface, 142, 143 Parent classes, 99 Patient movement monitor (see Movement monitor wearable) Philips Semiconductors: I2C protocol, 121 I2S protocol, 139 PHP scripting language, 145–149 Ping sensor sketch, 38–42 Pinout diagram, 25–26 Poky Linux, 63 C and C++ supported by, 72 Debian Linux vs., 77 and LAMP installation, 145 Node.js in, 73 Python with, 71 and SPI interface, 132 Power: for Intel Arduino Development Board, 13–14 for movement monitor wearable, 193–194, 200–201 for robotic car, 43, 45 Processing language, 23–42 average voltage measurement sketch, 28–31 data variables, 27–28 execution, 24–25 input and output statements, 25–27 and Intel Edison Arduino IDE, 23–24 mini-servo sketch, 34–38 Ping sensor sketch, 38–42 and sketches, 16 switch demo sketch, 31–34 Processor, Program mode, 84–85 Programs: comments in, 19 sketches vs., 16 (See also individual programs) Pulse stretcher gain (servos), 51 Pulse-width modulation (PWM): GPIO pins for, 140 pulse train applied to motors, 111, 112 servo control program, 104–106 Python, 84–85 accessing I2C devices from, 121 classes, 98–101 connection to MySQL database, 157–158 constants, 90 controlling GPIO pins with, 140 data types, 88–89 database connection to MySQL, 157–158 EMC class implementations, 112–116 functions, 90–91 help feature, 86–88 interactive mode (interpreted mode), 84 interpolated sensor measurements, 93–95 libmraa library installation, 101–112 loopback test, 132–133 MQTT library, 204–205 RTIMUlib for, 197 script mode (program mode), 84, 85 starting, 71–72 user-defined functions, 91–93 variables, 90 “will” concept in, 203 Q Quality of Service (QoS, MQTT), 202–203 Quark coprocessor, R RAM, Record locking, 184 Relational databases, 150, 151 Remote Network Driver Interface Specification (RNDIS), 65 Repetitive (looping) control, 24, 25 richards-tech.com RTIMUlib library, 197 RJ45 breakout board (Sparkfun), 166–170 RNDIS (Remote Network Driver Interface Specification), 65 Robotic car, 43–61 analog servo, 46–51 autonomous operation, 56–60 BOE-BOT kit and modifications for, 43–46 continuous rotation servos, 51–54 operating the, 60–61 Servo1 sketch, 54–55 RTIMUlib library (richards-tech.com), 197 S Script mode (Python), 84, 85 SD card interface, 142, 143 SD Host Controller Standard Specification 3.0, 142 Secure file transfer protocol (SFTP), 73 Secure shell (SSH), 83–84 Selection (conditional) control, 24, 25 Serial Monitor, 28 with average voltage measurement sketch, 30–31 with Ping sketch, 41, 42 Serial Peripheral Interface protocol (see SPI protocol) Serial protocols, 117–140 for EMCs, 101 I2C, 120–131 I2S, 139–140 SPI, 131–139 UART, 118–120 USB 2.0, 117 Servo control program (libmraa library), 104–106 Servo horn (analog servo), 46, 47 Servo1 sketch (robotic car), 54–55 Servos, 34 analog (see Analog servo motors) continuous rotation, 51–54, 99, 106–108 EMC design for, 99 mini-servo sketch, 34–38 mraa-based servo control program, 104–106 Setters, 115 SFTP (secure file transfer protocol), 73 Shields: Arduino, 43, 44 Arduino-compatible, for robotic car, 43, 44 Shift registers, 134 Silvermont Atom processor (Intel), Simula, 97 Sketches: comments in, 18–19 parts of, 19 programs vs., 16 (See also individual sketches) Sleep clock signal, 143 SMBus (System Management Bus) utilities tests, 130–131 Sound, I2S serial protocol, 139–140 Sparkfun: base module, 191, 192 Block, 7–9 hardware kit, 192 micro SD card, 142, 143 RJ45 breakout board, 166–170 stackable architecture of modules, 8, 9, 26, 191, 192 SPI (Serial Peripheral Interface) protocol, 131–139 connecting MCP3008 to dev board, 134–135 loopback test program, 132–133 testing MCP3008 with Edison, 135–139 SSH (secure shell), 83–84 SSI (Synchronous Serial Interface), 131 [See also SPI (Serial Peripheral Interface) protocol] ST Microelectronics LSM9DS0 inertial measurement unit (IMU), 194–195 Stackable architecture: of Sparkfun modules, 8, 9, 26, 191, 192 wearables project stack, 198–201 Stand-alone operation (robotic car), 56–60 Step-by-step control, 24–25 String constants (string literals), 90 String variable, 28 Strongly typed language, 27, 88 Subtopics, 205 sudo, 103, 197–198 Sweep sketch, 35–36 Switch demo (Blink 2) sketch, 31–34 Synchronous Serial Interface (SSI), 131 [See also SPI (Serial Peripheral Interface) protocol] System Management Bus (SMBus) utilities tests, 130–131 T Tables, in databases, 151–152 Temperature measurement system (see Home temperature measurement system) Temperature sensor: BMP085, 121–130 calibration, 91–93 Three-channel sensor system, for home temperature measurement system, 166–170 Time, 69–70 TMP36 temperature sensor (Analog Devices): for home temperature measurement system, 159–162 in multiple-sensor system, 168 Topics, 205 U UART (Universal Asynchronous Receive Transmit) serial protocol, 118–120 Ultrasonic sensor, for robotic car, 56 Unified Modeling Language (UML) diagram, 99 Unit of gravitation (g), 195 Universal Asynchronous Receive Transmit (UART) serial protocol, 118–120 Updating/upgrading Edison firmware, 67 USB communications, 117 Intel Arduino Development Board, 14–15 setting up, 64–65 USB OTG (On-The-Go), 14, 15 User-defined functions (Python), 91–93 V vi editor, 72 W Wearables, 191–213 battery module, 193–194 MQTT message protocol, 201–204 MQTT publisher client, 204–210 MQTT subscriber clients, 210–213 9DOF module, 194, 195 Paho project, 201 project stack, 198–201 software, 196–198 Sparkfun console module, 191, 192 stackable architecture, 191, 192 Web server: Apache, 146–149 means of user sending data to, 186 starting, 70–71 (See also LAMP installation) Website, creating, 184–186 Wheezy Debian Linux, 77, 78, 121 (See also Debian Linux) WiFi, set up with Debian distribution, 81–83 for wearables, 191, 194 Wills (MQTT), 203 Windows: connecting to Edison with, 64 installing drivers, 65 loading Debian on, 78–81 MQTT client for, 210 WinSCP, 73, 74 WM8804 (Wolfson Microelectronics), 139 Word select clock, 139 ... Working with Processing and the Intel Arduino IDE Edison- Controlled Robotic Car Connecting to Edison Linux with the Command-Line Prompt Debian Linux and Python Basics Python Classes, Methods, and the. .. Blink Sketch Summary Working with Processing and the Intel Arduino IDE The Processing Language and the Intel Edison Arduino IDE Processing Language Basics Input and Output Statements Data Variables... set up and operate the Intel Arduino Development Board with the Intel version of the Arduino IDE The next chapter goes into much further detail regarding how to program the Edison with the Arduino

Ngày đăng: 02/03/2019, 11:18

TỪ KHÓA LIÊN QUAN