Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction 2 Smart Design. What is smart design? 2 Everything is designed except nature The packaging of a Band-Aid The curve of a bike frame The shape.

Similar presentations


Presentation on theme: "Introduction 2 Smart Design. What is smart design? 2 Everything is designed except nature The packaging of a Band-Aid The curve of a bike frame The shape."— Presentation transcript:

1 Introduction 2 Smart Design

2 What is smart design? 2 Everything is designed except nature The packaging of a Band-Aid The curve of a bike frame The shape of a city street light Smart designs include a microprocessor (i.e. – a small computer) Logic gives the design “intelligence” Code is the language used

3 Arduino 3 Arduino’s are the baby of the desktop/laptop era Small portable computer (microprocessor + inputs/outputs) Programmed using Arduino Integrated Development Environment (IDE) Inputs (instead of mouse and keyboard) Buttons, flex sensors, etc. Outputs (instead of monitor and speakers) Motors, LEDs, etc.

4 SparkFun Inventor Kit 4 SparkFun Inventor Kit (SIK) compiles many components to interface with the Arduino Inputs produce voltages to be read by the Arduino Outputs are controlled using voltages produced by the Arduino Smart Design teaching tool!

5 Computer Code 5 LanguageCodeExamples Description NounsVariables Integers (int) Booleans (boolean) Letters (char) Variables hold data of certain types like numbers/arrays/letters VerbsStructures If, else, end For…end While…end Structures cause action. They can create loops, create switches, or define cases. Adjectives Comparison Operators Equal to (==) Less than (<) Greater than (<) Comparison operators describe variables in order to make logic based decisions Adverbs Arithmetic Operators Addition (+) Multiplication (*) Division (/) Arithmetic operators describe the action occurring between two variables PunctuationSyntax Semicolons (;) Brackets ({}) Parentheses () Syntax groups and separates code in discernible segments.

6 Variables 6 Variable = Noun Variables are the subject of the code (person/place/thing) Variables are distinguished by type Integers - int are whole numbers between [- 32768,32768] Boolean – boolean are either a true (1) or false (0) Letters – char are alphabet letters between [A-Z] Any many more – see ReferenceReference

7 Variables 7 Variables store information Write value to variable Read value from variable

8 Structures 8 Structures = Verbs Give the code motion/action Structures provide various actions For loops – repeats statements within loop for a certain number of times using a ‘counting’ variable If/else statements –tests to see if an equation is satisfied, then directs code to appropriate statements While loops – repeat statements within loop until condition is met

9 Structures 9 1.What is a for loop that you notice in your daily life? 2.What is an if/else statement that you notice in your daily life? QUIZ!

10 Structures 10 1.What is a for loop that you notice in your daily life? - Microwave 30second timer - Traffic lights turning green, then yellow, then red 2. What is an if/else statement that you notice in your daily life? - Alarm clock turning on at 6:26am - Street lights turning on at night Examples?

11 Comparison Operators 11 Comparison Operators = adjectives Describe variables by comparing to other values Comparison operators are mathematical inequality terms and return a boolean variable Equal to (==) – asks if two values are equal Not equal to (!=) – asks if two values are not equal Less/Greater than ( ) – asks if one variable is less/greater than another Any many more – see ReferenceReference

12 Arithmetic Operators 12 Arithmetic Operators = adverbs Describe the action occurring between two variables Arithmetic operators are mathematical operators between numeric variables Addition (+) – you know what this means… Multiplication (*) – you know what this means… Division (/) – you know what this means… Any many more – see ReferenceReference

13 Syntax 13 Syntax = punctuation Groups and separates code in discernible segments Syntax is required by computers in order to decipher the meaning of each line of code Semicolons (;) – ends a statement and will prevent complier errors Curly Braces ({}) – defines begin/end of various structures including for loops, if/else statements, and functions Parentheses () – many uses including defining order of operation in an equation, indicating arguments for a function, etc. Any many more – see ReferenceReference

14 Functions 14 Functions = paragraphs Short sequence of code with specific purpose/action Functions provide another method to organize code into discernible sections. Allows for easy reuse of code Commonly used functions digitalWrite() – write a HIGH or a LOW value to a digital pin (i.e. – output a voltage of 5V or 0V) analogRead() – read an analog signal and digitize using 10-bit analog to digital converter (i.e. – map input voltages [0-5V] to integers [0-1023] delay() – pauses the program for the specified amount of time Any many more – see Reference. Lots!!Reference

15 15 Color Code Variables Structures Comparison Operators Arithmetic Operators Syntax Functions Color code the following section of code so that all characters are colored QUIZ!

16 Open Ideas Reverse engineer a device that you use daily –Look up components, diagram how it works Diagram code for your favorite video game, cell phone application, etc. –Map the different inputs, logic, etc. 16


Download ppt "Introduction 2 Smart Design. What is smart design? 2 Everything is designed except nature The packaging of a Band-Aid The curve of a bike frame The shape."

Similar presentations


Ads by Google