SlideShare a Scribd company logo
Fabric Robots
Wuffy intro to your basic companion
bit.ly/FabricRobots
Download the slides at this link
Let’s have Fun learning!
Today’s Program
Make Eyes
Make Eyes Interact
Make it Move, part 1
Sketch your Design!
Make it Move, part 2
Making Your Robot!
Share and Tell!
Let’s Make Some Eyes!
Plug in a LED!
 Long end into hole
marked “13”.
 This is the pin number –
Pin 13.
 Short end into hole
marked “GND”.
Long
EndShort
End
Open up Arduino!
Robots are Silly!
 You need to tell the Robot what parts it has
 This is called “setting up”
 Robots only do what you tell it to do.
 These are “Commands”.
Type this into Arduino!
 void setup () {
pinMode (13, OUTPUT);
}
 void loop() {
digitalWrite (13, HIGH);
delay (1000);
digitalWrite (13, LOW);
}
Set Up
Commands
Arduino Grammar
 void setup () {
pinMode (13, OUTPUT);
}
 void loop() {
digitalWrite (13, HIGH);
delay (1000);
digitalWrite (13, LOW);
}
Set Up
Commands
If you open a
bracket…
… you must
close it
Every
“sentence”
ends with “;”
Lights, Setup and Commands
LEDs are lights we can control
Set up
pinMode (Pin_Number, OUTPUT);
Commands
digitalWrite (Pin_Number, HIGH/LOW);
digitalRead (Pin_Number);
Arduino Code is Simple!
Arduino code is split into 3 parts
1. Global variables
2. Set up
3. Functions (where you give it
commands)
[Global Variables go here]
Void setup() {
[Set up goes here]
}
Void loop() {
[Commands go here]
}
Let’s Make the Eyes Interactive!
Looks complex? No fear!
Trigger: Push button
Button can trigger other commands!
Set up
pinMode (Pin_Number, INPUT);
Commands
digitalRead (Pin_Number);
Push to Start – Pt1
 const int buttonPin = 2;
int buttonState = LOW;
 void setup () {
pinMode (buttonPin, INPUT);
}
Set Up
Global
Variable
Push to Start – Pt2
 void loop () {
buttonState = digitalRead (buttonPin);
if (buttonState == HIGH) {
COMMANDS When Switch is on GO HERE!
}
else {
COMMANDS When Switch is off GO HERE!
}
}
Commands
Let’s Make the Robot Move!
Servos make your Robot move!
Servos are the “muscles” of a robot.
 Servos can only turn in circles
 Servos have to be declared as a Global variable
Declare
#include “Servo.h”
Servo Servo_Name;
Set up
Servo_Name.attach (Pin_Number);
Commands
Servo_Name.write (angle);
Let’s Connect the Servo!
Move that Servo! Pt1
 const int TailPin = 9;
#include “Servo.h”
Servo Tail;
 void setup() {
Tail.attach(TailPin);
}
Set Up
Global
Variable
Move that Servo! Pt2
 void loop () {
Tail.write (30);
delay (500);
Tail.write (150);
delay (500);
Tail.write (0);
delay (500);
Tail.write (180);
}
How do we wave?
Commands
Angles
Waving! Pt1
Let’s break down how to wave!
1. Arm goes left
2. Arm stops
3. Arm goes right
4. Arm stops
Rephrase it!
1. Arm goes (1 degree) left every
second
2. Arm stops at 180 degrees
3. Arm goes (1 degree) right every
second
4. Arm stops at 0 degrees
Waving! Pt2
 Int angle = 0;
 void loop () {
for (angle = 0; angle <180; angle++) {
Tail.write(angle);
delay (15);
}
}
How do we wave backwards?
Commands
Global
Variable
More Robots
Extra Resources
Blinking the Eyes
Let’s break down how to blink!
1. Open eyes
2. Wait a second
3. Close eyes
4. Wait a second
5. Open eyes
Rephrase it!
1. (If eyes are closed) Open eyes
2. Wait half a second
3. (If eyes are open) Close eyes
4. Wait half a second
5. (If eyes are closed) Open eyes

More Related Content

Similar to Fabric robots

Keyless Door Entry via Bluetooth Technology
Keyless Door Entry via Bluetooth TechnologyKeyless Door Entry via Bluetooth Technology
Keyless Door Entry via Bluetooth Technology
Matthew Weppler
 
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for Beginners
Sarwan Singh
 
Musical Machines and Flapping Phones
Musical Machines and Flapping PhonesMusical Machines and Flapping Phones
Musical Machines and Flapping Phones
Neil Mendoza
 
Arduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch SlidesArduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch Slides
Mithi Sevilla
 
[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노
Chiwon Song
 
robotics presentation for a club you run
robotics presentation for a club you runrobotics presentation for a club you run
robotics presentation for a club you run
SunilAcharya37
 
Weapons grade React by Ken Wheeler
Weapons grade React by Ken Wheeler Weapons grade React by Ken Wheeler
Weapons grade React by Ken Wheeler
React London 2017
 
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADScottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RAD
lostcaggy
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
Mujahid Hussain
 
Arduino section programming slides
Arduino section programming slidesArduino section programming slides
Arduino section programming slides
vivek k
 
Introduction to arduino Programming with
Introduction to arduino Programming withIntroduction to arduino Programming with
Introduction to arduino Programming with
likhithkumpala159
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
Jeni Shah
 
Html5 game, websocket e arduino
Html5 game, websocket e arduinoHtml5 game, websocket e arduino
Html5 game, websocket e arduino
monksoftwareit
 
Arduino Section Programming - from Sparkfun
Arduino Section Programming - from SparkfunArduino Section Programming - from Sparkfun
Arduino Section Programming - from Sparkfun
JhaeZaSangcapGarrido
 
AstroBot session 2
AstroBot session 2AstroBot session 2
AstroBot session 2
osos_a215
 
67WS Seminar Event
67WS Seminar Event67WS Seminar Event
67WS Seminar Event
Shigeru Kobayashi
 
Arduino sectionprogramming slides
Arduino sectionprogramming slidesArduino sectionprogramming slides
Arduino sectionprogramming slides
Jorge Joens
 
Hackathon Taiwan 5th : Arduino 101
Hackathon Taiwan  5th : Arduino 101 Hackathon Taiwan  5th : Arduino 101
Hackathon Taiwan 5th : Arduino 101
twunishen
 
Python and the Raspberry Pi
Python and the Raspberry PiPython and the Raspberry Pi
Python and the Raspberry Pi
Rachel Wang
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Luki B. Subekti
 

Similar to Fabric robots (20)

Keyless Door Entry via Bluetooth Technology
Keyless Door Entry via Bluetooth TechnologyKeyless Door Entry via Bluetooth Technology
Keyless Door Entry via Bluetooth Technology
 
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for Beginners
 
Musical Machines and Flapping Phones
Musical Machines and Flapping PhonesMusical Machines and Flapping Phones
Musical Machines and Flapping Phones
 
Arduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch SlidesArduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch Slides
 
[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노
 
robotics presentation for a club you run
robotics presentation for a club you runrobotics presentation for a club you run
robotics presentation for a club you run
 
Weapons grade React by Ken Wheeler
Weapons grade React by Ken Wheeler Weapons grade React by Ken Wheeler
Weapons grade React by Ken Wheeler
 
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADScottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RAD
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
 
Arduino section programming slides
Arduino section programming slidesArduino section programming slides
Arduino section programming slides
 
Introduction to arduino Programming with
Introduction to arduino Programming withIntroduction to arduino Programming with
Introduction to arduino Programming with
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
 
Html5 game, websocket e arduino
Html5 game, websocket e arduinoHtml5 game, websocket e arduino
Html5 game, websocket e arduino
 
Arduino Section Programming - from Sparkfun
Arduino Section Programming - from SparkfunArduino Section Programming - from Sparkfun
Arduino Section Programming - from Sparkfun
 
AstroBot session 2
AstroBot session 2AstroBot session 2
AstroBot session 2
 
67WS Seminar Event
67WS Seminar Event67WS Seminar Event
67WS Seminar Event
 
Arduino sectionprogramming slides
Arduino sectionprogramming slidesArduino sectionprogramming slides
Arduino sectionprogramming slides
 
Hackathon Taiwan 5th : Arduino 101
Hackathon Taiwan  5th : Arduino 101 Hackathon Taiwan  5th : Arduino 101
Hackathon Taiwan 5th : Arduino 101
 
Python and the Raspberry Pi
Python and the Raspberry PiPython and the Raspberry Pi
Python and the Raspberry Pi
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 

More from Endian Neo

Automated Dispenser: The Path to Madness lies in Small Steps
Automated Dispenser: The Path to Madness lies in Small StepsAutomated Dispenser: The Path to Madness lies in Small Steps
Automated Dispenser: The Path to Madness lies in Small Steps
Endian Neo
 
Wire controlled cars
Wire controlled carsWire controlled cars
Wire controlled cars
Endian Neo
 
DIY 3D Movies
DIY 3D MoviesDIY 3D Movies
DIY 3D Movies
Endian Neo
 
Fusion360 a guide to freeform modelling
Fusion360   a guide to freeform modellingFusion360   a guide to freeform modelling
Fusion360 a guide to freeform modelling
Endian Neo
 
That's a lamp a guide to freeform modelling
That's a lamp   a guide to freeform modellingThat's a lamp   a guide to freeform modelling
That's a lamp a guide to freeform modelling
Endian Neo
 
3 d design & printing, Fusion360 1-2-3
3 d design & printing, Fusion360 1-2-33 d design & printing, Fusion360 1-2-3
3 d design & printing, Fusion360 1-2-3
Endian Neo
 

More from Endian Neo (6)

Automated Dispenser: The Path to Madness lies in Small Steps
Automated Dispenser: The Path to Madness lies in Small StepsAutomated Dispenser: The Path to Madness lies in Small Steps
Automated Dispenser: The Path to Madness lies in Small Steps
 
Wire controlled cars
Wire controlled carsWire controlled cars
Wire controlled cars
 
DIY 3D Movies
DIY 3D MoviesDIY 3D Movies
DIY 3D Movies
 
Fusion360 a guide to freeform modelling
Fusion360   a guide to freeform modellingFusion360   a guide to freeform modelling
Fusion360 a guide to freeform modelling
 
That's a lamp a guide to freeform modelling
That's a lamp   a guide to freeform modellingThat's a lamp   a guide to freeform modelling
That's a lamp a guide to freeform modelling
 
3 d design & printing, Fusion360 1-2-3
3 d design & printing, Fusion360 1-2-33 d design & printing, Fusion360 1-2-3
3 d design & printing, Fusion360 1-2-3
 

Recently uploaded

Getting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by NeontribeGetting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by Neontribe
Harry Harrold
 
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
ijk38lw
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
lunaemel03
 
Introduction to User experience design for beginner
Introduction to User experience design for beginnerIntroduction to User experience design for beginner
Introduction to User experience design for beginner
ellemjani
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
Jaime Brown
 
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
881evgn0
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
Kyungeun Sung
 
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
9lq7ultg
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
k7nm6tk
 
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
bo44ban1
 
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
kuapy
 
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
wkip62b
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
Virtual Real Design
 
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
3vgr39kx
 
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
hw2xf1m
 
一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样
tobbk6s8
 
NHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree TranscriptNHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree Transcript
lhtvqoag
 
LGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation TemplateLGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation Template
DakshGudwani
 
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHINHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
NishantRathi18
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
Knight Moves
 

Recently uploaded (20)

Getting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by NeontribeGetting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by Neontribe
 
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
 
Introduction to User experience design for beginner
Introduction to User experience design for beginnerIntroduction to User experience design for beginner
Introduction to User experience design for beginner
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
 
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
 
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
 
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
 
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
 
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
 
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
 
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
 
一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样
 
NHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree TranscriptNHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree Transcript
 
LGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation TemplateLGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation Template
 
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHINHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
 

Fabric robots

  • 1. Fabric Robots Wuffy intro to your basic companion
  • 3. Let’s have Fun learning! Today’s Program Make Eyes Make Eyes Interact Make it Move, part 1 Sketch your Design! Make it Move, part 2 Making Your Robot! Share and Tell!
  • 5. Plug in a LED!  Long end into hole marked “13”.  This is the pin number – Pin 13.  Short end into hole marked “GND”. Long EndShort End
  • 7. Robots are Silly!  You need to tell the Robot what parts it has  This is called “setting up”  Robots only do what you tell it to do.  These are “Commands”.
  • 8. Type this into Arduino!  void setup () { pinMode (13, OUTPUT); }  void loop() { digitalWrite (13, HIGH); delay (1000); digitalWrite (13, LOW); } Set Up Commands
  • 9. Arduino Grammar  void setup () { pinMode (13, OUTPUT); }  void loop() { digitalWrite (13, HIGH); delay (1000); digitalWrite (13, LOW); } Set Up Commands If you open a bracket… … you must close it Every “sentence” ends with “;”
  • 10. Lights, Setup and Commands LEDs are lights we can control Set up pinMode (Pin_Number, OUTPUT); Commands digitalWrite (Pin_Number, HIGH/LOW); digitalRead (Pin_Number);
  • 11. Arduino Code is Simple! Arduino code is split into 3 parts 1. Global variables 2. Set up 3. Functions (where you give it commands) [Global Variables go here] Void setup() { [Set up goes here] } Void loop() { [Commands go here] }
  • 12. Let’s Make the Eyes Interactive!
  • 14. Trigger: Push button Button can trigger other commands! Set up pinMode (Pin_Number, INPUT); Commands digitalRead (Pin_Number);
  • 15. Push to Start – Pt1  const int buttonPin = 2; int buttonState = LOW;  void setup () { pinMode (buttonPin, INPUT); } Set Up Global Variable
  • 16. Push to Start – Pt2  void loop () { buttonState = digitalRead (buttonPin); if (buttonState == HIGH) { COMMANDS When Switch is on GO HERE! } else { COMMANDS When Switch is off GO HERE! } } Commands
  • 17. Let’s Make the Robot Move!
  • 18. Servos make your Robot move! Servos are the “muscles” of a robot.  Servos can only turn in circles  Servos have to be declared as a Global variable Declare #include “Servo.h” Servo Servo_Name; Set up Servo_Name.attach (Pin_Number); Commands Servo_Name.write (angle);
  • 20. Move that Servo! Pt1  const int TailPin = 9; #include “Servo.h” Servo Tail;  void setup() { Tail.attach(TailPin); } Set Up Global Variable
  • 21. Move that Servo! Pt2  void loop () { Tail.write (30); delay (500); Tail.write (150); delay (500); Tail.write (0); delay (500); Tail.write (180); } How do we wave? Commands
  • 23. Waving! Pt1 Let’s break down how to wave! 1. Arm goes left 2. Arm stops 3. Arm goes right 4. Arm stops Rephrase it! 1. Arm goes (1 degree) left every second 2. Arm stops at 180 degrees 3. Arm goes (1 degree) right every second 4. Arm stops at 0 degrees
  • 24. Waving! Pt2  Int angle = 0;  void loop () { for (angle = 0; angle <180; angle++) { Tail.write(angle); delay (15); } } How do we wave backwards? Commands Global Variable
  • 27. Blinking the Eyes Let’s break down how to blink! 1. Open eyes 2. Wait a second 3. Close eyes 4. Wait a second 5. Open eyes Rephrase it! 1. (If eyes are closed) Open eyes 2. Wait half a second 3. (If eyes are open) Close eyes 4. Wait half a second 5. (If eyes are closed) Open eyes