Arduino

Páginas: 71 (17541 palabras) Publicado: 20 de noviembre de 2012
1

Getting Arduino
Table of Contents

Started

with

2

Preface Acknowledgments How to Contact Us 1. Introduction Intended Audience Interaction Design is the design of any interactive experience. What Is Physical Computing? 2. The Arduino Way Prototyping Tinkering Patching Circuit Bending Keyboard Hacks We Love Junk! Hacking Toys Collaboration 3. The Arduino Platform

3

TheArduino Hardware 14 Digital IO pins (pins 0–13) 6 Analogue In pins (pins 0–5) 6 Analogue Out pins (pins 3, 5, 6, 9, 10, and 11) The Software (IDE) Installing Arduino on Your Computer Installing Drivers: Macintosh Installing Drivers: Windows Port Identification: Macintosh Port Identification: Windows 4. Really Getting Started with Arduino Anatomy of an Interactive Device Sensors and Actuators Blinkingan LED Pass Me the Parmesan Arduino Is Not for Quitters Real Tinkerers Write Comments The Code, Step by Step What We Will Be Building What Is Electricity? Using a Pushbutton to Control the LED How Does This Work? One Circuit, A Thousand Behaviours 5. Advanced Input and Output

4

Trying Out Other On/Off Sensors Switches Thermostats Magnetic switches (also known as "reed relays") Carpetswitches Tilt switches Controlling Light with PWM Use a Light Sensor Instead of the Pushbutton Analogue Input Try Other Analogue Sensors Serial Communication Driving Bigger Loads (Motors, Lamps, and the Like) Complex Sensors 6. Talking to the Cloud Digital Output Digital Output Analog Output Digital Input Analog Input Serial Communication Planning Coding Assembling the Circuit Here's How to AssembleIt: 7. Troubleshooting

5

Understanding Understanding Simplification and segmentation Exclusion and certainty Testing the Board Testing Your Breadboarded Circuit Isolating Problems Problems with the IDE How to Get Help Online A. The Breadboard B. Reading Resistors and Capacitors C. Arduino Quick Reference

6

STRUCTURE SPECIAL SYMBOLS ; (semicolon) {} (curly braces) comments CONSTANTSVARIABLES boolean char byte int unsigned int long unsigned long float double string array CONTROL STRUCTURES if … else for switch case while do … while break continue return ARITHMETIC AND FORMULAS COMPARISON OPERATORS

7

BOOLEAN OPERATORS COMPOUND OPERATORS increment and decrement (–– and ++) += , –=, *= and /= INPUT AND OUTPUT FUNCTIONS pinMode(pin, mode) digitalWrite(pin, value) intdigitalRead(pin) int analogRead(pin) analogWrite(pin, value) shiftOut(dataPin, clockPin, bitOrder, value) unsigned long pulseIn(pin, value) TIME FUNCTIONS unsigned long millis() delay(ms) delayMicroseconds(us) MATH FUNCTIONS min(x, y) max(x, y) abs(x) constrain(x, a, b) map(value, fromLow, fromHigh, toHigh) double pow(base, exponent) double sqrt(x) double sin(rad) double cos(rad) double tan(rad)

toLow,8

RANDOM NUMBER FUNCTIONS randomSeed(seed) long random(max) long random(min, max) SERIAL COMMUNICATION Serial.begin(speed) Serial.print(data) Serial.print(data, encoding) Serial.println(data) Serial.println(data, encoding) int Serial.available() int Serial.read() Serial.flush() D. Reading Schematic Diagrams

9

Getting Arduino

Started

with

Massimo Banzi
Copyright © 2009Massimo Banzi O'Reilly books may be purchased for educational, business, or sales promotional use. For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com. The O'Reilly logo is a registered trademark of O'Reilly Media, Inc. The Make: Projects series designations and related trade dress are trademarks of O'Reilly Media, Inc. The trademarks ofthird parties used in this work are the property of their respective owners. Important Message to Our Readers: Your safety is your own responsibility, including proper use of equipment and safety gear, and determining whether you have adequate skill and experience. Electricity and other resources used for these projects are dangerous unless used properly and with adequate precautions, including...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Arduino
  • Que es arduino
  • Arduinos
  • ARDUINO
  • Arduino
  • Arduino UNO
  • Arduino
  • arduino

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS