AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

Similar documents
Microsoft PowerPoint - STU_EC_Ch08.ppt

Microsoft PowerPoint - ATF2015.ppt [相容模式]

Microsoft Word - AP1515V02

C/C++ - 字符输入输出和字符确认

Microsoft Word - LD5515_5V1.5A-DB-01 Demo Board Manual

MICROCHIP EVM Board : APP APP001 PICmicro Microchip APP001 40pin PDIP PICmicro Design Tips Character LCM Temperature Sensor Application I/O Pi

V6800/V6600 3D

iml88-0v C / 8W T Tube EVM - pplication Notes. IC Description The iml88 is a Three Terminal Current Controller (TTCC) for regulating the current flowi

iml v C / 4W Down-Light EVM - pplication Notes. IC Description The iml8683 is a Three Terminal Current Controller (TTCC) for regulating the cur

untitled

AL-M200 Series

Edge-Triggered Rising Edge-Triggered ( Falling Edge-Triggered ( Unit 11 Latches and Flip-Flops 3 Timing for D Flip-Flop (Falling-Edge Trigger) Unit 11

iml v C / 0W EVM - pplication Notes. IC Description The iml8683 is a Three Terminal Current Controller (TTCC) for regulating the current flowin

FILTRON 1. DC AC AC 220V 50HZ / / / / 4. 1) / DC AC FILTRON DC AC FILTRON DC 12V 12VDC D

B 6 A A N A S A +V B B B +V 2

untitled

版本说明书

目 录

an153f

SDP

1

1.ai

untitled

<4D F736F F D C4EAC0EDB9A4C0E04142BCB6D4C4B6C1C5D0B6CFC0FDCCE2BEABD1A15F325F2E646F63>

1 TPIS TPIS 2 2

C/C++ - 文件IO

epub83-1

穨2700使用手冊.doc

RS-232C [11-13] 1 1 (PLC) (HMI) Visual Basic (PLC) 402

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor

R1.25-3S

2/80 2

Application Note Format

a b c d e f g C2 C1 2

Cube20S small, speedy, safe Eextremely modular Up to 64 modules per bus node Quick reaction time: up to 20 µs Cube20S A new Member of the Cube Family

目录

TX-NR3030_BAS_Cs_ indd

Logitech Wireless Combo MK45 English

ICD ICD ICD ICD ICD

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2

IP505SM_manual_cn.doc

Outline USB Application Requirements Variable Definition Communications Code for VB Code for Keil C Practice

Pin Configurations Figure2. Pin Configuration of FS2012 (Top View) Table 1 Pin Description Pin Number Pin Name Description 1 GND 2 FB 3 SW Ground Pin.

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

1377_SNAP_Selection_Guide.fm

CD DX Onkyo CD CD Cs

Arduino 1-1 Arduino 1-2 Arduino 1-3 Arduino IDE

Serial ATA ( Silicon Image SiI3114)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 5 (4) S A T A... 8 (5) S A T A... 10

PIC_SERVER (11) SMTP ( ) ( ) PIC_SERVER (10) SMTP PIC_SERVER (event driven) PIC_SERVER SMTP 1. E-

S3125A 2

Microsoft Word - MTK平台生产软件使用说明.doc

K7VT2_QIG_v3

LK110_ck

Learning Java

Gerotor Motors Series Dimensions A,B C T L L G1/2 M G1/ A 4 C H4 E

System Design and Setup of a Robot to Pass over Steps Abstract In the research, one special type of robots that can pass over steps is designed and se

02

冷熱衝擊試驗機、溫度控制器

行业

2782_OME_KM_Cover.qxd

行业

行业

C/C++ - 函数

Go构建日请求千亿微服务最佳实践的副本

untitled

SDS 1.3

行业

行业

Bus Hound 5

P3B-F Pentium III/II/Celeron TM

穨control.PDF

Gerolor Motors Series Dimensions A,B C T L L G1/2 M8 G1/ A 4 C H4 E

audiogram3 Owners Manual

目 录 目 录 1. 安 装 和 快 速 入 门 附 件 1.1 随 机 附 件 附 件 信 息... 3 连 接 和 设 定 1.3 连 接 记 录 纸... 4 快 速 入 门 1.5 发 送 传 真 / 复 印 接 收 传 真

GH1220 Hall Switch

Abstract arm linux tool-chain root NET-Start! 2

10X21X26_OG_KOR.indd

PTS7_Manual.PDF

Microsoft PowerPoint - Sens-Tech WCNDT [兼容模式]

USPTO Academic research Corporate needs Global/International Inventors Libraries News Media/Publication Patent Attorney or Agent USPTO e (ebusiness Ce

MODEL 62000H SERIES 5KW / 10KW / 15KW 0 ~ 375A 0 ~ 1000V/2000V( ) : 200/220Vac, 380/400Vac, 440/480Vac 3U/15KW / & 150KW / ( 10 ms ~ 99 hours)

C语言的应用.PDF

<4D F736F F D20CEDECEFDD0C5BDDDB5E7C6F8B9C9B7DDD3D0CFDEB9ABCBBECAD7B4CEB9ABBFAAB7A2D0D0B9C9C6B1D5D0B9C9CBB5C3F7CAE9A3A8C9EAB1A8B8E C4EA36D4C238C8D5B1A8CBCDA3A92E646F63>

BC04 Module_antenna__ doc

1-S40A...-1 DAT00452 V.005

ebook140-8

Guide to Install SATA Hard Disks

热设计网

<4D F736F F D20C9CFBAA3BFC6BCBCB4F3D1A7D0C5CFA2D1A7D4BA C4EAC7EFBCBEC8EBD1A7B2A9CABFD7CAB8F1BFBCCAD4CAB5CAA9CFB8D4F22D C8B7B6A8B8E5>

csg(1_29)cs.p65

2015 Chinese FL Written examination

立项报告内容提要

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP

untitled

Microsoft Word - 3D手册2.doc

Microsoft Word - Arduino电子积木用户手册 V doc

Epson

2 : ; :


(02) (02) (02) (02) (02

Transcription:

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

前言 - Andrew Payne

目录 1 2 Firefly Basics 3 COMPONENT TOOLBOX

目录 4 RESOURCES

致谢

1 ARDUINO 1.1 Arduino? - source http://www.arduino.cc 1.2 Arduino IDE 1.3 AN INTRODUCTION TO ELECTRONICS

1.4 - http://www.arduino.cc AN INTRODUCTION TO ELECTRONICS

1 ARDUINO 1.5 DigitalRead AnalogRead Digital Write Analog Write Pulse Width Modulation PWM Pulse Width Modulation AN INTRODUCTION TO ELECTRONICS

1.6 /* Blink an LED using Digital Write. The circuit LED connected from digital pin 13 to ground. */ int LEDpin = 13; // LED connected to digital pin 13 void setup(){ // the digital pin as an output pinmode(ledpin, OUTPUT); } void loop(){ digitalwrite(ledpin, HIGH); // turn the LED on delay(1000); // wait for one second digitalwrite(ledpin, LOW); // turn the LED delay(1000); // wait for one second } AN INTRODUCTION TO ELECTRONICS

1 ARDUINO /* Blink an LED using Digital Write. The circuit: LED connected from digital pin 13 to ground. */ int LEDpin = 13; // LED connected to digital pin 13 void setup() void setup AN INTRODUCTION TO ELECTRONICS

void setup() void setup(){ // the digital pin as an output pinmode(ledpin, OUTPUT); } void loop(){ digitalwrite(ledpin, HIGH); // turn the LED on delay(1000); // wait for one second digitalwrite(ledpin, LOW); // turn the LED delay(1000); // wait for one second } 1.7 AN INTRODUCTION TO ELECTRONICS

1 ARDUINO 1.8 1.9 AN INTRODUCTION TO ELECTRONICS

/* Fade an LED using Analog Write The circuit LED connected through 220ohm resistor to digital pin 3 and to ground. Ω */ int LEDpin = 3; //connect LED to pin 3 int brightness = 0; // how bright the LED is int fadeamount = 5; // step value for LED void setup(){ pinmode(ledpin, OUTPUT); // declare LEDpin to be an output } void loop(){ analogwrite(ledpin, brightness); // write the PWM value to LEDpin // change the brightness for next through the loop brightness = brightness + fadeamount; } // reverse the of the fading at the ends of the fade if (brightness <= 0 brightness >= 255) { fadeamount = -fadeamount; } delay(30); // wait for 30 milliseconds to slow down the dimming analogwrite(ledpin, brightness); // write the PWM value to LEDpin // change the brightness for next through the loop brightness = brightness + fadeamount; AN INTRODUCTION TO ELECTRONICS

1 ARDUINO // reverse the of the fading at the ends of the fade if (brightness <= 0 brightness >= 255) { fadeamount = -fadeamount; } delay(30); // wait for 30 milliseconds to slow down the dimming 1.10 AN INTRODUCTION TO ELECTRONICS

1.11 1.12 AN INTRODUCTION TO ELECTRONICS

1 ARDUINO 1.13 橙色黄色绿色蓝色紫色灰色白色 金色 银色 1.14 AN INTRODUCTION TO ELECTRONICS

1.15 /* AnalogReadSerial Reads an analog input on pin 0, prints the result to the serial monitor */ void setup() { Serial.begin(115200); //start the serial } void loop() { int sensorvalue = analogread(0); Serial.println(sensorValue); } int sensorvalue = analogread(0); Serial.println(sensorValue); AN INTRODUCTION TO ELECTRONICS

1 ARDUINO 1.16 1.17 AN INTRODUCTION TO ELECTRONICS

1.18 AN INTRODUCTION TO ELECTRONICS

1 ARDUINO Serial Monitor 1.19 AN INTRODUCTION TO ELECTRONICS

/* AnalogReadSerial Reads an analog input on pin 0, prints the result to the serial monitor Use the Analog sensor value to precisely control a standard servo */ #include <Servo.h> //import the servo library to use Servo MyServo; //create a variable of type Servo int ServoPin = 9; //connect the signal pin of the servo to Digital Pin 9 void setup() { Serial.begin(115200); //start the serial MyServo. (ServoPin); } void loop() { int sensorvalue = analogread(0); Serial.println(sensorValue); //remap the raw sensor values into a range for Servo (0-180) sensorvalue = map(sensorvalue,0,1023,0,180); MyServo.write(sensorValue); //set the servo to remapped value } #include <Servo.h> //import the servo library to use Servo MyServo; //create a variable of type Servo AN INTRODUCTION TO ELECTRONICS

1 ARDUINO int ServoPin = 9; //connect the signal pin of the servo to Digital Pin 9 void setup() { Serial.begin(115200); //start the serial MyServo. (ServoPin); } //remap the raw sensor values into a range for Servo (0-180) sensorvalue = map(sensorvalue,0,1023,0,180); AN INTRODUCTION TO ELECTRONICS

MyServo.write(sensorValue); //set the servo to remapped value 1.20 AN INTRODUCTION TO ELECTRONICS

1 ARDUINO 1.21 /* The circuit */ int = 7; // the number of the pin int LEDPin = 13; // the number of the LED pin int = 0; // variable for reading the status void setup(){ pinmode(ledpin, OUTPUT); // the LED pin as output pinmode INPUT); // the pin as input } void loop(){ // read the state of the value digitalread // sets the LED to the value digitalwrite(ledpin, } AN INTRODUCTION TO ELECTRONICS

digitalread digitalwrite(ledpin, 1.22 AN INTRODUCTION TO ELECTRONICS

1 ARDUINO 1.23 /* The circuit */ int = 7; // the pin that the is to int LEDPin = 13; // the pin that the LED is to int = 0; // counter for the number of presses int = 0; // current state of the int = 0; // previous state of the void setup() { pinmode INPUT); pinmode(ledpin, OUTPUT); Serial.begin(115200); } void loop() { digitalread // compare the to its previous state if!= { // if the state has changed, increment the counter if == HIGH) { Serial.println( current state: pressed ); Serial.print( number of pushes: ); Serial.println DEC); // Code onto next page... AN INTRODUCTION TO ELECTRONICS

// Code from previous page... }else{ Serial.println( current state: unpressed ); } } // save the current state as the last state for next through the loop. } // turns on the LED every other press by checking the modulo of counter. if % 2 == 0){ digitalwrite(ledpin, HIGH); }else{ digitalwrite(ledpin, LOW); } if!= { if == HIGH) { = + 1; AN INTRODUCTION TO ELECTRONICS

1 ARDUINO Serial.println( current state: pressed ); Serial.print( number of pushes: ); Serial.println DEC); if % 2 == 0){ if % 2 == 0){ digitalwrite(ledpin, HIGH); }else{ digitalwrite(ledpin, LOW); } AN INTRODUCTION TO ELECTRONICS

2 FIREFLY BASICS 2.1 2.2 AN INTRODUCTION TO ELECTRONICS

2 FIREFLY BASICS 2.3 WinAVR ReacTIVision AN INTRODUCTION TO ELECTRONICS

2.4 2.5 2.6 AN INTRODUCTION TO ELECTRONICS

2 FIREFLY BASICS 2.7 AN INTRODUCTION TO ELECTRONICS

AN INTRODUCTION TO ELECTRONICS

2 FIREFLY BASICS 2.8 AN INTRODUCTION TO ELECTRONICS

2.9 Digital PWM: AN INTRODUCTION TO ELECTRONICS

2 FIREFLY BASICS Servo AN INTRODUCTION TO ELECTRONICS

Uno WriteDPin3PWM AN INTRODUCTION TO ELECTRONICS

2 FIREFLY BASICS 2.10 AN INTRODUCTION TO ELECTRONICS

AN INTRODUCTION TO ELECTRONICS

2 FIREFLY BASICS AN INTRODUCTION TO ELECTRONICS

3 COMPONENT TOOLBOX 3.1 Ports Available Open/Close Port Uno Read Uno Write Mega Read Mega Write Serial Read (Generic) Serial Write (Generic) AN INTRODUCTION TO ELECTRONICS

3 COMPONENT TOOLBOX Arduino Code Generator Upload to I/O Board 3.2 Reactivision Wii Nunchuck 3.3 Networking OSC Listener OSC Sender AN INTRODUCTION TO ELECTRONICS

UDP Listener UDP Sender Pachube Read XML Search 3.4 Binary Blink Counter Fader One Way Fader Two Way Buffer Data Log Is Key Pressed AN INTRODUCTION TO ELECTRONICS

3 COMPONENT TOOLBOX Playback Constrain Smoothing Frame Rate Stop Watch AND Flip Flop NOR Flip Flop Bang State Detection AN INTRODUCTION TO ELECTRONICS

4 RESOURCES 4.1 4.2 4.3 4.4 4.5 4.6 LEDS 4.7 AN INTRODUCTION TO ELECTRONICS

4 RESOURCES 4.8 4.9 4.10 4.11 AN INTRODUCTION TO ELECTRONICS

AN INTRODUCTION TO ELECTRONICS

NOTES AN INTRODUCTION TO ELECTRONICS

NOTES AN INTRODUCTION TO ELECTRONICS