WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements

Size: px
Start display at page:

Download "WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements"

Transcription

1 Item 5: It's Totally Random Monday, 5 October 08 :5 PM IT'S TOTALLY RANDOM EXPLORE WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements WILF - Defined how each component works by identifying or describing their qualities. - Identified where and why component are connected into the GPIO - Described how the circuit works and the relationships between components. A B C The student work has the following characteristics: The student work has the following characteristics: The student work has the following characteristics: Processes and purposeful definition and decomposition of complex problems in terms of production skills functional and non-functional requirements Investigating and defining - Defined how all components works by identifying or describing their qualities. - Identified why and where all of the components are connected into the GPIO - Described how the whole circuit works, with both text and images. effective definition and decomposition of complex problems in terms of functional and non-functional requirements - Defined how most components works by identifying or describing their qualities. - Identified why and where most of the components are connected into the GPIO - Described how the circuit works, with both text and images. definition and decomposition of complex problems in terms of functional and non-functional requirements - Defined how some components works by identifying or describing their qualities. - Identified why and where some of the components are connected into the GPIO - Described how the circuit works. Difficulty: easy Estimated Effort: 70 Mins Value: 0% Components List: Arduino Board USB Cable Piezo Buzzer Physical Computing and Embedded Sytems Page

2 The Piezo Buzzer is turned on and off with HIGH and LOW. Piezos contain a very thin plate inside the housing that moves when an electrical current is applied. When alternating current is applied (such as on... off... on... off), the plate vibrates and generates sound waves. It s simple to use piezos with Arduino because they can be turned on and off just like an LED. The piezo elements are not polarized and can be connected in either direction. Pins used: GND, The Voltage passing through the Arduino board is that same as USB Type - 5V. Pins 0- are Digital and so an on (5V)or off (0V) pulse is passed through them. If you wanted to have a component that is continuously on, like a light bulb, then you need to pulse on and off very rapidly so that it appears that a steady voltage is passing out the pin. This is called Pulse Width Modulation (PWM). In this item, you will only be outputting a HIGH(5V) or on and LOW (0V) or off signal through pin. The Circuit: The code will output a 5V digital pulse through pin, which will cause the Piezo Buzzer to make a sound. INSTRUCTIONS. Plug in the Piezo Buzzer into the GND and pin. Connect the RGB LED as shown in the Fritzing (circuit) diagram above. Take a photo for your portfolio, or set up a virtual circuit in tinkercad and take a screenshot.. Answer these questions: Portfolio Task Questions for EXPLORE. Define how each of the components work? Identify each component and describe how they work with text and images.. Identify what and where components are plugged into the GPIO. Why there?. Describe How the circuit works? Tell the story. Include a picture. [ use ] Physical Computing and Embedded Sytems Page

3 DEVELOP WALT: design and evaluation of user experiences and algorithms WILF Design - interpret existing code: > Analyse to identify where input, output, processing and storage occurs in the code. > translated code into pseudocode - Plan to modify parts of the code to make it work differently or more effectively Evaluation - Recommended ways to use the technology differently. Processes and production skills Generating and designing - producing and implementing A B C The student work has the following characteristics: The student work has the following characteristics: The student work has the following characteristics: purposeful design and evaluation of user experiences and algorithms - identified where all input, output, processing and storage occurs in the code. - translated all code into pseudocode - Plan to modify several parts of the code to make it work differently - Recommended ways to use the technology differently. effective design and evaluation of user experiences and algorithms - identified where most input, output, processing and storage occurs in the code. - translated most code into pseudocode - Plan to modify some parts of the code to make it work differently - Recommended some ways to use the technology differently. design and evaluation of user experiences and algorithms - identified where some input, output, processing and storage occurs in the code. - translated some code into pseudocode - Plan to modify some parts of the code to make it work differently - Recommended a way to use the technology differently. Algorithms: Sequence, iteration Code structure, values and functions: int [Data Types] To store a value in code, we use variables. There are many kinds of values or types of data that we may want to store. Integers are your primary data-type for number storage From < pinmode() [Digital I/O] Configures the specified pin to behave either as an input or an output pinmode(pin, mode) Parameters pin: the number of the pin whose mode you wish to set mode: INPUT, OUTPUT, or INPUT_PULLUP. (see the (digital pins) page for a more complete description of the functionality.) From < delay() [Time] Pauses the program for the amount of time (in milliseconds) specified as parameter. (There are 000 milliseconds in a second.) delay(ms) Physical Computing and Embedded Sytems Page

4 Parameters ms: the number of milliseconds to pause (unsigned long) From < random() The random function generates pseudo-random numbers. random(max) random(min, max) Parameters min - lower bound of the random value, inclusive (optional) max - upper bound of the random value, exclusive Returns A random number between min and max- (long). From < tone() [Advanced I/O] Generates a square wave of the specified frequency (and 50% duty cycle) on a pin. A duration can be specified, otherwise the wave continues until a call to notone(). The pin can be connected to a piezo buzzer or other speaker to play tones. Only one tone can be generated at a time. If a tone is already playing on a different pin, the call to tone() will have no effect. If the tone is playing on the same pin, the call will set its frequency. Use of the tone() function will interfere with PWM output on pins and (on boards other than the Mega). It is not possible to generate tones lower than Hz. For technical details, see Brett Hagman s notes. tone(pin, frequency) tone(pin, frequency, duration) Parameters pin: the pin on which to generate the tone frequency: the frequency of the tone in hertz - unsigned int duration: the duration of the tone in milliseconds (optional) - unsigned long From < for [Control Structure] The for statement is used to repeat a block of statements enclosed in curly braces. An increment counter is usually used to incrementand terminate the loop. The for statement is useful for any repetitive operation, and is often used in combination with arrays to operate on collections of data/pins. for (initialization; condition; increment) { //statement(s); The initialization happens first and exactly once. Each time through the loop, the condition is tested; if it s true, the statement block, and the increment is executed, then the condition is tested again. When the condition becomes false, the loop ends. From < See Item 4 for details about the tone() function. How the for loop works Let s take a close look at what is inside the parenthesis following the for loop: void setup() { for (int thispin = ; thispin < 8; thispin++) { Let s take a close look at what is inside the parenthesis following the for loop: for (int thispin = ; thispin < 8; thispin++) There are three separate statements in the parenthesis separated by a semicolon. The first statement is initialization of thecounter variable used in the for loop, it looks like any other variable declaration and initialization you have seen: Physical Computing and Embedded Sytems Page 4

5 int thispin = ; The thispin variable is what is used in the next statement called the test: thispin < 8; This is the test condition that tells the loop to keep going or to stop. If the condition is TRUE, the code in the curly brackets of the for loop will be executed again, if the condition is FALSE, the program will stop executing the statement in the for loop and move forward in the program. When we first evaluate this test condition, the thispin variable equals and the test is < 8 We know that is less than 8, so we execute the code in the curly brackets of the for loop. But before we look at the code in the curly brackets of the for loop let s finish with the final statement in the parenthesis of the for loop: thispin++ The ++ syntax means the same thing as Add to the value of variable thispin. Since adding the number one to a value issuch a common calculation to perform, the syntax ++ was created to make it even easier. Otherwise you would write: thispin = thispin + //which is the same as thispin++ On an aside, there is also a shorthand for decrementing a variable by : thispin- - //this shorthand subtracts the value from thispin On yet another aside, you can increment and decrement by any amount using the following shorthand: thispin += 4 //the += means add 4 to the variable on the left a handy syntax shortcut thispin -=4 //the -= means subtract 4 to the variable on the left another handy syntax shortcut In most cases for loops increment by the number, just keep in mind that you can increment however you choose. Enough about incrementing! What the heck is the point already? Ok, here is the deal if the condition of the for loop is met, then code in the curly brackets is executed and the counter variable is incremented. The next time through the for loop, if the condition is still met, then the code once again is executed and the counter variable is incremented again. Eventually your counter variable will grow large enough that the condition will no longer be satisfied and the for loop will end. 4 5 for (int thispin = ; thispin < 8; thispin++) { In this example, when the thispin variable gets larger than 7, the loop will stop. What is awesome about the counter variable is that we usually use it inside the for loop to help do something. In this case, the code that gets executed is: You are familiar with the pinmode() function it sets the mode of a pin. Here the number of the pin is specified by the counter variable. So what happens? The first time through the for loop, the thispin variable is equal to. Since is less than 8 (the test condition), we go ahead and execute the code inside the curly brackets: () <<< Pin is set as OUTPUT After the for loop ends the first time, we increment thispin (thispin++) so it now holds the value. Next we check the condition again, and since is indeed less than 8, the code is executed another time: Physical Computing and Embedded Sytems Page 5

6 () <<< Pin is set as OUTPUT After the for loop ends the second time, we increment thispin as before so it now holds the value 4. We check the condition we know 4 is less than 8, and we execute the code in the curly brackets of the for loop again: (4) <<< Pin 4 is set as OUTPUT This incrementing and condition testing goes on until thispin is equal to 8, now the test condition is not met, and the for loop ends and all of our pins have their mode set. Seems a bit convoluted perhaps? Consider a for loop vs. what hard coding would require: pinmode(, OUTPUT); pinmode(, OUTPUT); pinmode(4, OUTPUT); pinmode(5, OUTPUT); pinmode(6, OUTPUT); pinmode(7, OUTPUT); You can see that the for loop saved us a lot of typing! With a for loop if you decide to add LEDs, all you have to do is change the test condition by simply changing a single number. In the hard coding version you have to add more pinmode() functions to get the same result. Efficiency rocks stay away from hard coding. From < The for loop in our code for(int i = random(, 8); i > 0; i = i - random(,5)) - i is the 'counter' variable and it is set with a random initial value between and 7 (remember, it is below the max value of8 and not including 8) - the 'run the loop' condition is to keep looping while the counter, i, is a positive number (i>0). - the counter, i, is decreased in value by taking away a number between and 4 Want to know more? USING RANDOM NUMBERS WITH ARDUINO The code (sketch) causes the piezo buzzer to let off random beeps at random times. INSTRUCTIONS. Save the sketch (code) below and then open in the Arduino IDE (File>Open..) Totally_Ran dom. Copy the code into a place where you can edit it to add comments.. Answer the following: Portfolio Task Questions for DEVELOP. Where are the Input, output, storage in the code? Feature Code. How does the code work - pseudocode a. Copy the existing code b. Place comments (//) next to each line of code in pseudocode. How will you modify the circuit and/or the code to make it do something different or more effectively? 4. How could you use this technology in another way to improve the way it works or apply it to a different situation? How to write pseudocode Accepting inputs Operation Pseudocode Programming equivalent Prompt user for surname Input surname var person = prompt("please enter your name"); Physical Computing and Embedded Sytems Page 6

7 Producing outputs Print the message Hello World console.log( Hello World ); Assigning values to variables Set the total to 0 var total = 0; Performing arithmetic set total to items times price var total = items * price; Selection and Perform alternative actions Iteration or Repeating operations. Pre-test loop also known as the WHILE loop Iteration or Repeating operations. Post-test loop eg the REPEAT/UNTIL or DO/WHILE loops Iteration or Repeating operations. Counting loop also known as the FOR loop. IF mark is greater than 49 THEN print Pass ELSE print Fail WHILE total greater than 0 subtract new purchase from total ENDWHILE REPEAT <Block> UNTIL condition FOR Index = START_VALUE to FINISH_VALUE <Block> ENDFOR if (mark > 49) { console.log( Pass ); else { console.log( Fail ); while (total > 0) { total = total - new_purchase; var i = 0; do { text += "The number is " + i; i++; while (i < 5); var i; for (i = 0; i < cars.length; i++) { text += cars[i] + "<br>"; GENERATE WALT: design and implementation of modular programs, including an object-oriented program, using algorithms and data structures involving modular functions that reflect the relationships of real-world data and data entities WILF - Code implemented Processes and production skills Generating and designing - producing and implementing A B C The student work has the following characteristics: The student work has the following characteristics: The student work has the following characteristics: purposeful design and proficient implementation of modular programs, including an object-oriented program, using algorithms and data structures involving modular functions that reflect the relationships of real-world data and data entities - All code implemented effective design and effective implementation of modular programs, including an design and implementation of modular programs, including an objectoriented program, using algorithms and data structures involving modular object-oriented program, using algorithms and data structures involving modular functions that reflect the relationships of real-world data and data entities functions that reflect the relationships of real-world data and data entities - Most code implemented - Some code implemented INSTRUCTIONS. Plug in the Piezo Buzzer into the GND and pin. Take a photo for your portfolio, or set up a virtual circuit in tinkercad and take a screenshot.. Test your board with the 'Blink' sketch. Save the sketch (code) below and then open in the Arduino IDE (File>Open..) Totally_Ran dom 4. Double-check that you have the right board (Tools>Board) and COM port (Tools>Port) selected. 5. Upload your sketch (Sketch>Upload or 6. You should hear a quiet 'ticking' sound coming from the piezo buzzer, at random intervals. Youtube Video: 7. Copy and paste the code to your portfolio. Read and translate the code into pseudocode by commenting (add \\ at the end of each line) each line of code. Eg: pinmode(, OUTPUT); // set pin as an output pin 8. Modify the code to make it work differently or more effectively. Eg. Change the delay 9. Re-upload your code 0. Take a video for your portfolio.. Answer the questions below: Portfolio Task Questions for GENERATE. Get the hardware and software working. Get your modifications working and highlight where you have altered the code. document Physical Computing and Embedded Sytems Page 7

8 . Record a very short video of your working solution. EVALUATE AND REFINE WALT: evaluation of information systems and their solutions in terms of risk, sustainability and potential for innovation and enterprise WILF - Makes judgments about ideas, works, solutions or methods in relation to risk, sustainability and potential for innovation and enterprise Processes and production skills Evaluating A B C The student work has the following characteristics: The student work has the following characteristics: The student work has the following characteristics: discerning evaluation of information systems and their solutions in terms of risk, sustainability and potential for innovation and enterprise - All sections of evaluation completed and thorough. informed evaluation of information systems and their solutions in terms of risk, sustainability and potential for innovation and enterprise - Most sections of evaluation completed and thorough. evaluation of information systems and their solutions in terms of risk, sustainability and potential for innovation and enterprise - Most sections of evaluation completed. Portfolio Task Questions for EVALUATE AND REFINE. Update your kanban and burndown chart. Write a short evaluation Evaluation Critically evaluate your completed digital solution by using the organiser below. Make sure that you use full sentences and copy and paste text into paragraphs rather than leaving it in table form. Digital solution evaluation Enterprise needs and opportunities What needs or opportunities does the solution address? Risks What risks does the digital solution pose to the user s personal security? Could the digital solution have any adverse effects on the stakeholders? Sustainability How could the digital solution impact the environment? What economic factors might influence the digital solution? Is your solution easy to use and learn? Why/Why not? Are there any social factors which could affect the solution? Innovative How is the digital solution innovative? Recommendations Recommend at least one improvement that you would like to see made to the digital solution. Want More? Want More? Physical Computing and Embedded Sytems Page 8

9 [ Parts 0k Resistor RGB LED scifi_dash candle magic8 magic8_ Physical Computing and Embedded Sytems Page 9

WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements

WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements Item 1: The Clock is Ticking Monday, 15 October 2018 12:19 PM EXPLORE WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements - Defined how each component

More information

WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements

WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements Item 12: Burglar Alarmed Monday, 15 October 2018 12:31 PM BURGLAR ALARMED EXPLORE WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements WILF - Defined

More information

GOOD MORNING SUNSHINE

GOOD MORNING SUNSHINE Item 11: Good Morning Sunshine Monday, 15 October 2018 12:30 PM GOOD MORNING SUNSHINE EXPLORE WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements

More information

To lead your students through this activity, you will need your computer, attached to a projector, for projecting your code for students to see.

To lead your students through this activity, you will need your computer, attached to a projector, for projecting your code for students to see. To lead your students through this activity, you will need your computer, attached to a projector, for projecting your code for students to see. INSTALL THE SOFTWARE Download and install the Arduino integrated

More information

More Arduino Programming

More Arduino Programming Introductory Medical Device Prototyping Arduino Part 2, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota More Arduino Programming Digital I/O (Read/Write) Analog

More information

Arduino Part 2. Introductory Medical Device Prototyping

Arduino Part 2. Introductory Medical Device Prototyping Introductory Medical Device Prototyping Arduino Part 2, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota More Arduino Programming Digital I/O (Read/Write) Analog

More information

Counter & LED (LED Blink)

Counter & LED (LED Blink) 1 T.R.E. Meeting #1 Counter & LED (LED Blink) September 17, 2017 Contact Info for Today s Lesson: President Ryan Muller mullerr@vt.edu 610-573-1890 Learning Objectives: Learn how to use the basics of Arduino

More information

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas Physics 364 Arduino Lab 1 Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas Vithayathil/Kroll Introduction Last revised: 2014-11-12 This lab introduces you to an electronic development

More information

Procedure: Determine the polarity of the LED. Use the following image to help:

Procedure: Determine the polarity of the LED. Use the following image to help: Section 2: Lab Activity Section 2.1 Getting started: LED Blink Purpose: To understand how to upload a program to the Arduino and to understand the function of each line of code in a simple program. This

More information

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino University of Portland EE 271 Electrical Circuits Laboratory Experiment: Arduino I. Objective The objective of this experiment is to learn how to use the Arduino microcontroller to monitor switches and

More information

Arduino Prof. Dr. Magdy M. Abdelhameed

Arduino Prof. Dr. Magdy M. Abdelhameed Course Code: MDP 454, Course Name:, Second Semester 2014 Arduino What is Arduino? Microcontroller Platform Okay but what s a Microcontroller? Tiny, self-contained computers in an IC Often contain peripherals

More information

Introduction To Arduino

Introduction To Arduino Introduction To Arduino What is Arduino? Hardware Boards / microcontrollers Shields Software Arduino IDE Simplified C Community Tutorials Forums Sample projects Arduino Uno Power: 5v (7-12v input) Digital

More information

University of Hull Department of Computer Science C4DI Interfacing with Arduinos

University of Hull Department of Computer Science C4DI Interfacing with Arduinos Introduction Welcome to our Arduino hardware sessions. University of Hull Department of Computer Science C4DI Interfacing with Arduinos Vsn. 1.0 Rob Miles 2014 Please follow the instructions carefully.

More information

Project 12 Piezo Sounder Melody Player

Project 12 Piezo Sounder Melody Player Project 12 Piezo Sounder Melody Player Rather than using the piezo to make annoying alarm sounds, why not use it to play a melody? You are going to get your Arduino to play the chorus of Puff the Magic

More information

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives: ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives: This lab will introduce basic embedded systems programming concepts by familiarizing the user with an embedded programming

More information

Arduino Programming and Interfacing

Arduino Programming and Interfacing Arduino Programming and Interfacing Stensat Group LLC, Copyright 2017 1 Robotic Arm Experimenters Kit 2 Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and

More information

Arduino 07 ARDUINO WORKSHOP 2007

Arduino 07 ARDUINO WORKSHOP 2007 ARDUINO WORKSHOP 2007 PRESENTATION WHO ARE WE? Markus Appelbäck Interaction Design program at Malmö University Mobile networks and services Mecatronics lab at K3, Malmö University Developer, Arduino community

More information

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Note. The above image and many others are courtesy of   - this is a wonderful resource for designing circuits. Robotics and Electronics Unit 2. Arduino Objectives. Students will understand the basic characteristics of an Arduino Uno microcontroller. understand the basic structure of an Arduino program. know how

More information

analogwrite(); The analogwrite function writes an analog value (PWM wave) to a PWM-enabled pin.

analogwrite(); The analogwrite function writes an analog value (PWM wave) to a PWM-enabled pin. analogwrite(); The analogwrite function writes an analog value (PWM wave) to a PWM-enabled pin. Syntax analogwrite(pin, value); For example: analogwrite(2, 255); or analogwrite(13, 0); Note: Capitalization

More information

Robotics and Electronics Unit 5

Robotics and Electronics Unit 5 Robotics and Electronics Unit 5 Objectives. Students will work with mechanical push buttons understand the shortcomings of the delay function and how to use the millis function. In this unit we will use

More information

Prototyping & Engineering Electronics Kits Basic Kit Guide

Prototyping & Engineering Electronics Kits Basic Kit Guide Prototyping & Engineering Electronics Kits Basic Kit Guide odysseyboard.com Please refer to www.odysseyboard.com for a PDF updated version of this guide. Guide version 1.0, February, 2018. Copyright Odyssey

More information

Coding Workshop. Learning to Program with an Arduino. Lecture Notes. Programming Introduction Values Assignment Arithmetic.

Coding Workshop. Learning to Program with an Arduino. Lecture Notes. Programming Introduction Values Assignment Arithmetic. Coding Workshop Learning to Program with an Arduino Lecture Notes Table of Contents Programming ntroduction Values Assignment Arithmetic Control Tests f Blocks For Blocks Functions Arduino Main Functions

More information

Grove - Buzzer. Introduction. Features

Grove - Buzzer. Introduction. Features Grove - Buzzer Introduction The Grove - Buzzer module has a piezo buzzer as the main component. The piezo can be connected to digital outputs, and will emit a tone when the output is HIGH. Alternatively,

More information

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved Update: Ver 1.3 Dec 2018 Arduino Learning Guide For Beginner Using Created by Cytron Technologies Sdn Bhd - All Rights Reserved LESSON 0 SETTING UP HARDWARE & SOFTWARE Part 1: Put Up Label Stickers for

More information

Microcontrollers and Interfacing week 8 exercises

Microcontrollers and Interfacing week 8 exercises 2 HARDWARE DEBOUNCING Microcontrollers and Interfacing week 8 exercises 1 More digital input When using a switch for digital input we always need a pull-up resistor. For convenience, the microcontroller

More information

TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO

TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO AGENDA ARDUINO HARDWARE THE IDE & SETUP BASIC PROGRAMMING CONCEPTS DEBUGGING & HELLO WORLD INPUTS AND OUTPUTS DEMOS ARDUINO HISTORY IN 2003 HERNANDO

More information

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved Update: Ver 1.3 Dec 2018 Arduino Learning Guide For Beginner Using Created by Cytron Technologies Sdn Bhd - All Rights Reserved LESSON 0 SETTING UP HARDWARE & SOFTWARE Part 1: Put Up Label Stickers for

More information

Simple Sounders and Sensors

Simple Sounders and Sensors C H A P T E R 4 Simple Sounders and Sensors This chapter is going to get noisy. You re going to attach a piezo sounder to your Arduino in order to add alarms, warning beeps, alert notifications, etc. to

More information

Halloween Pumpkinusing. Wednesday, October 17, 12

Halloween Pumpkinusing. Wednesday, October 17, 12 Halloween Pumpkinusing Blink LED 1 What you will need: 1 MSP-EXP430G2 1 3 x 2 Breadboard 3 560 Ohm Resistors 3 LED s (in Red Color Range) 3 Male to female jumper wires 1 Double AA BatteryPack 2 AA Batteries

More information

REPETITION CONTROL STRUCTURE LOGO

REPETITION CONTROL STRUCTURE LOGO CSC 128: FUNDAMENTALS OF COMPUTER PROBLEM SOLVING REPETITION CONTROL STRUCTURE 1 Contents 1 Introduction 2 for loop 3 while loop 4 do while loop 2 Introduction It is used when a statement or a block of

More information

Introduction. C provides two styles of flow control:

Introduction. C provides two styles of flow control: Introduction C provides two styles of flow control: Branching Looping Branching is deciding what actions to take and looping is deciding how many times to take a certain action. Branching constructs: if

More information

Introduction to Microcontrollers Using Arduino. PhilRobotics

Introduction to Microcontrollers Using Arduino. PhilRobotics Introduction to Microcontrollers Using Arduino PhilRobotics Objectives Know what is a microcontroller Learn the capabilities of a microcontroller Understand how microcontroller execute instructions Objectives

More information

Programming. The Programmable Box! with. Programming made fun Ages 10+ V1.0 Copyright 2014, 2015 Your Inner Geek, LLC

Programming. The Programmable Box! with. Programming made fun Ages 10+ V1.0 Copyright 2014, 2015 Your Inner Geek, LLC C Programming with The Programmable Box! Programming made fun Ages 10+ 1 Copyright 2014, 2015 by Your Inner Geek, LLC. All rights reserved. Except as permitted under the United States Copyright Act of

More information

Make your own secret locking mechanism to keep unwanted guests out of your space!

Make your own secret locking mechanism to keep unwanted guests out of your space! KNOCK LOCK Make your own secret locking mechanism to keep unwanted guests out of your space! Discover : input with a piezo, writing your own functions Time : 1 hour Level : Builds on projects : 1,,3,4,5

More information

CS 106 Introduction to Computer Science I

CS 106 Introduction to Computer Science I CS 106 Introduction to Computer Science I 02 / 15 / 2016 Instructor: Michael Eckmann Questions? Comments? Loops to repeat code while loops for loops do while loops Today s Topics Logical operators Example

More information

Wire Loop Game Nerves of Steel and Arduino in control

Wire Loop Game Nerves of Steel and Arduino in control Post Project No. Wire Loop Game Nerves of Steel and Arduino in control Here s a multi-player (max. ) version of that nerve-racking game called Wire Loop where contestants have to pass a metal loop around

More information

COMS 469: Interactive Media II

COMS 469: Interactive Media II COMS 469: Interactive Media II Agenda Review Data Types & Variables Decisions, Loops, and Functions Review gunkelweb.com/coms469 Review Basic Terminology Computer Languages Interpreted vs. Compiled Client

More information

Fall Harris & Harris

Fall Harris & Harris E11: Autonomous Vehicles Fall 2011 Harris & Harris PS 1: Welcome to Arduino This is the first of five programming problem sets. In this assignment you will learn to program the Arduino board that you recently

More information

Introduction to Arduino. Wilson Wingston Sharon

Introduction to Arduino. Wilson Wingston Sharon Introduction to Arduino Wilson Wingston Sharon cto@workshopindia.com Physical computing Developing solutions that implement a software to interact with elements in the physical universe. 1. Sensors convert

More information

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University CS 112 Introduction to Computing II Wayne Snyder Department Boston University Today: Java basics: Compilation vs Interpretation Program structure Statements Values Variables Types Operators and Expressions

More information

The Big Idea: Background:

The Big Idea: Background: Lesson 7 Lesson 7: For For Loops Loops The Big Idea: This lesson simplifies the control of digital pins by assigning the pin numbers to an integer variable and by calling the digitalwrite command multiple

More information

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 05 I/O statements Printf, Scanf Simple

More information

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail Reacting to Sensors In this tutorial we will be going over how to program the Arduino to react to sensors. By the end of this workshop you will have an understanding of how to use sensors with the Arduino

More information

V3 1/3/2015. Programming in C. Example 1. Example Ch 05 A 1. What if we want to process three different pairs of integers?

V3 1/3/2015. Programming in C. Example 1. Example Ch 05 A 1. What if we want to process three different pairs of integers? Programming in C 1 Example 1 What if we want to process three different pairs of integers? 2 Example 2 One solution is to copy and paste the necessary lines of code. Consider the following modification:

More information

The Big Idea: Background: About Serial

The Big Idea: Background: About Serial Lesson 6 Lesson 6: Serial Serial Input Input The Big Idea: Information coming into an Arduino sketch is called input. This lesson focuses on text in the form of characters that come from the user via the

More information

University of Technology. Laser & Optoelectronics Engineering Department. C++ Lab.

University of Technology. Laser & Optoelectronics Engineering Department. C++ Lab. University of Technology Laser & Optoelectronics Engineering Department C++ Lab. Fifth week Control Structures A program is usually not limited to a linear sequence of instructions. During its process

More information

Lesson 25 Flood Warning System

Lesson 25 Flood Warning System Lesson 25 Flood Warning System 1 What you will need CloudProfessor (CPF) Moisture Sensor Buzzer Arduino Leonardo Android Shield USB lead Overview In this lesson, students will create a flood warning system

More information

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 23 Introduction to Arduino- II Hi. Now, we will continue

More information

CTEC 1802 Embedded Programming Labs

CTEC 1802 Embedded Programming Labs CTEC 1802 Embedded Programming Labs This document is intended to get you started using the Arduino and our I/O board in the laboratory - and at home! Many of the lab sessions this year will involve 'embedded

More information

Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S

Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S Overview Motivation Circuit Design and Arduino Architecture Projects Blink the LED Switch Night Lamp

More information

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process Lab 01 Arduino 程式設計實驗 Essential Arduino Programming and Digital Signal Process Arduino Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's

More information

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018 StenBOT Robot Kit 1 Stensat Group LLC, Copyright 2018 Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and documentation. There is a 90 day warranty for the

More information

CS 106 Introduction to Computer Science I

CS 106 Introduction to Computer Science I CS 106 Introduction to Computer Science I 06 / 04 / 2015 Instructor: Michael Eckmann Today s Topics Questions / comments? Calling methods (noting parameter(s) and their types, as well as the return type)

More information

CHAD Language Reference Manual

CHAD Language Reference Manual CHAD Language Reference Manual INTRODUCTION The CHAD programming language is a limited purpose programming language designed to allow teachers and students to quickly code algorithms involving arrays,

More information

Lesson 16 Musical Door Bell

Lesson 16 Musical Door Bell Lesson 16 Musical Door Bell 1 What you will need CloudProfessor (CPF) Buzzer Arduino Leonardo Arduino Shield USB cable Overview In this lesson, students will explore how to create music with the CloudProfessor.

More information

Lesson 6A Loops. By John B. Owen All rights reserved 2011, revised 2014

Lesson 6A Loops. By John B. Owen All rights reserved 2011, revised 2014 Lesson 6A Loops By John B. Owen All rights reserved 2011, revised 2014 Topic List Objectives Loop structure 4 parts Three loop styles Example of a while loop Example of a do while loop Comparison while

More information

FUNCTIONS For controlling the Arduino board and performing computations.

FUNCTIONS For controlling the Arduino board and performing computations. d i g i t a l R e a d ( ) [Digital I/O] Reads the value from a specified digital pin, either HIGH or LOW. digitalread(pin) pin: the number of the digital pin you want to read HIGH or LOW Sets pin 13 to

More information

CS50 Supersection (for those less comfortable)

CS50 Supersection (for those less comfortable) CS50 Supersection (for those less comfortable) Friday, September 8, 2017 3 4pm, Science Center C Maria Zlatkova, Doug Lloyd Today s Topics Setting up CS50 IDE Variables and Data Types Conditions Boolean

More information

CS112 Lecture: Repetition Statements

CS112 Lecture: Repetition Statements CS112 Lecture: Repetition Statements Objectives: Last revised 2/18/05 1. To explain the general form of the java while loop 2. To introduce and motivate the java do.. while loop 3. To explain the general

More information

The DTMF generator comprises 3 main components.

The DTMF generator comprises 3 main components. Make a DTMF generator with an Arduino board This article is for absolute beginners, and describes the design and construction of a DTMF generator. DTMF generators are often used to signal with equipment

More information

G. Tardiani RoboCup Rescue. EV3 Workshop Part 1 Introduction to RobotC

G. Tardiani RoboCup Rescue. EV3 Workshop Part 1 Introduction to RobotC RoboCup Rescue EV3 Workshop Part 1 Introduction to RobotC Why use RobotC? RobotC is a more traditional text based programming language The more compact coding editor allows for large programs to be easily

More information

Lesson 8: Digital Input, If Else

Lesson 8: Digital Input, If Else Lesson 8 Lesson 8: Digital Input, If Else Digital Input, If Else The Big Idea: This lesson adds the ability of an Arduino sketch to respond to its environment, taking different actions for different situations.

More information

Lesson 5: LDR Control

Lesson 5: LDR Control Lesson 5: LDR Control Introduction: Now you re familiar with the DIY Gamer and editing in an Arduino sketch. its time to write one from scratch. In this session you will write that talks to the Light Dependent

More information

Java Programming: Guided Learning with Early Objects Chapter 5 Control Structures II: Repetition

Java Programming: Guided Learning with Early Objects Chapter 5 Control Structures II: Repetition Java Programming: Guided Learning with Early Objects Chapter 5 Control Structures II: Repetition Learn about repetition (looping) control structures Explore how to construct and use: o Counter-controlled

More information

Smart Objects. SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi

Smart Objects. SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi Smart Objects SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi 1 What is a Smart Object? Essentially, an object that: Senses Thinks Acts 2 Example 1 https://www.youtube.com/watch?v=6bncjd8eke0

More information

Digital Pins and Constants

Digital Pins and Constants Lesson Lesson : Digital Pins and Constants Digital Pins and Constants The Big Idea: This lesson is the first step toward learning to connect the Arduino to its surrounding world. You will connect lights

More information

Chapter 5. Repetition. Contents. Introduction. Three Types of Program Control. Two Types of Repetition. Three Syntax Structures for Looping in C++

Chapter 5. Repetition. Contents. Introduction. Three Types of Program Control. Two Types of Repetition. Three Syntax Structures for Looping in C++ Repetition Contents 1 Repetition 1.1 Introduction 1.2 Three Types of Program Control Chapter 5 Introduction 1.3 Two Types of Repetition 1.4 Three Structures for Looping in C++ 1.5 The while Control Structure

More information

Programming. The Programmable Box! with. Programming made fun Ages 10+ V1.0 Copyright 2014, 2015 Your Inner Geek, LLC

Programming. The Programmable Box! with. Programming made fun Ages 10+ V1.0 Copyright 2014, 2015 Your Inner Geek, LLC C Programming with The Programmable Box! Programming made fun Ages 10+ 1 Copyright 2014, 2015 by Your Inner Geek, LLC. All rights reserved. Except as permitted under the United States Copyright Act of

More information

Handy Cricket Programming

Handy Cricket Programming Handy Cricket Programming Reference Overview The Handy Cricket is programmed in a language called Cricket Logo, which is a simplified version of the powerful yet easy-to-learn Logo language. Cricket Logo

More information

If Statements, For Loops, Functions

If Statements, For Loops, Functions Fundamentals of Programming If Statements, For Loops, Functions Table of Contents Hello World Types of Variables Integers and Floats String Boolean Relational Operators Lists Conditionals If and Else Statements

More information

Control Tone with IR Remote

Control Tone with IR Remote Lesson 17 Lesson 17: Control Tone with IR Remote Control Tone with IR Remote The Big Idea: The ability to detect and decode Sony-protocol infrared messages, which was explored in Lesson 16, can be added

More information

IME-100 Interdisciplinary Design and Manufacturing

IME-100 Interdisciplinary Design and Manufacturing IME-100 Interdisciplinary Design and Manufacturing Introduction Arduino and Programming Topics: 1. Introduction to Microprocessors/Microcontrollers 2. Introduction to Arduino 3. Arduino Programming Basics

More information

Lecture Transcript While and Do While Statements in C++

Lecture Transcript While and Do While Statements in C++ Lecture Transcript While and Do While Statements in C++ Hello and welcome back. In this lecture we are going to look at the while and do...while iteration statements in C++. Here is a quick recap of some

More information

LAB PROCEDURE. Lab Objectives 1. Generate a project using the GR-Sakura web compiler 2. Edit/Compile/Build/Debug the project using the web compiler

LAB PROCEDURE. Lab Objectives 1. Generate a project using the GR-Sakura web compiler 2. Edit/Compile/Build/Debug the project using the web compiler Lab Objectives 1. Generate a project using the GR-Sakura web compiler 2. Edit/Compile/Build/Debug the project using the web compiler Lab Materials Please verify you have the following materials at your

More information

Repetition Structures

Repetition Structures Repetition Structures Chapter 5 Fall 2016, CSUS Introduction to Repetition Structures Chapter 5.1 1 Introduction to Repetition Structures A repetition structure causes a statement or set of statements

More information

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution.

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution. Repetition Structures Introduction to Repetition Structures Chapter 5 Spring 2016, CSUS Chapter 5.1 Introduction to Repetition Structures The Problems with Duplicate Code A repetition structure causes

More information

Lesson 8: Simon - Arrays

Lesson 8: Simon - Arrays Lesson 8: Simon - Arrays Introduction: As Arduino is written in a basic C programming language, it is very picky about punctuation, so the best way to learn more complex is to pick apart existing ones.

More information

STUDENT LESSON A12 Iterations

STUDENT LESSON A12 Iterations STUDENT LESSON A12 Iterations Java Curriculum for AP Computer Science, Student Lesson A12 1 STUDENT LESSON A12 Iterations INTRODUCTION: Solving problems on a computer very often requires a repetition of

More information

PDF of this portion of workshop notes:

PDF of this portion of workshop notes: PDF of this portion of workshop notes: http://goo.gl/jfpeym Teaching Engineering Design with Student-Owned Digital and Analog Lab Equipment John B. Schneider Washington State University June 15, 2015 Overview

More information

How to approach a computational problem

How to approach a computational problem How to approach a computational problem A lot of people find computer programming difficult, especially when they first get started with it. Sometimes the problems are problems specifically related to

More information

CARTOOINO Projects Book

CARTOOINO Projects Book 1 CARTOOINO Projects Book Acknowledgement Acknowledgement This Cartooino Projects Book is a cartoon based adaptation of the Arduino Projects Book. The Cartooino Project Book was developed by the GreenLab

More information

Java Programming: Guided Learning with Early Objects Chapter 5 Control Structures II: Repetition

Java Programming: Guided Learning with Early Objects Chapter 5 Control Structures II: Repetition Java Programming: Guided Learning with Early Objects Chapter 5 Control Structures II: Repetition Learn about repetition (looping) control structures Explore how to construct and use: o Counter-controlled

More information

Energia MSP-430!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1

Energia MSP-430!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1 Energia MSP-430 1 3 Energia 4 4 4 6 8 9 Energia 11 18 2 IIB Energia MSP-430 IIB C C++ 3 Energia Energia MSP-430 Windows Mac OS Linux MSP-430, http://www.energia.nu, Max OS X, windows Linux Mac OS X, energia-

More information

Lesson 27 CPF Weather Station

Lesson 27 CPF Weather Station Lesson 27 CPF Weather Station 1 What you will need CloudProfessor (CPF) Moisture Sensor Water sensor Temp & humidity sensor Arduino Leonardo Android Shield USB lead Overview In this lesson, students will

More information

C++ Reference NYU Digital Electronics Lab Fall 2016

C++ Reference NYU Digital Electronics Lab Fall 2016 C++ Reference NYU Digital Electronics Lab Fall 2016 Updated on August 24, 2016 This document outlines important information about the C++ programming language as it relates to NYU s Digital Electronics

More information

8. Control statements

8. Control statements 8. Control statements A simple C++ statement is each of the individual instructions of a program, like the variable declarations and expressions seen in previous sections. They always end with a semicolon

More information

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

Serial.begin ( ); Serial.println( ); analogread ( ); map ( ); Control and Serial.begin ( ); Serial.println( ); analogread ( ); map ( ); A system output can be changed through the use of knobs, motion, or environmental conditions. Many electronic systems in our world

More information

Arduino Uno Microcontroller Overview

Arduino Uno Microcontroller Overview Innovation Fellows Program Arduino Uno Microcontroller Overview, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota Arduino Uno Power & Interface Reset Button USB

More information

Robotics Adventure Book Scouter manual STEM 1

Robotics Adventure Book Scouter manual STEM 1 Robotics Robotics Adventure Book Scouter Manual Robotics Adventure Book Scouter manual STEM 1 A word with our Scouters: This activity is designed around a space exploration theme. Your Scouts will learn

More information

Only to be used for arranged hours. Order of Operations

Only to be used for arranged hours. Order of Operations Math 84 Activity # 1 Your name: Order of Operations Goals: 1) Evaluate Real numbers with Exponents. ) Use the Order of Operations to Evaluate Expressions. ) Review Exponents and Powers of Ten Integer exponents

More information

CGS 3066: Spring 2015 JavaScript Reference

CGS 3066: Spring 2015 JavaScript Reference CGS 3066: Spring 2015 JavaScript Reference Can also be used as a study guide. Only covers topics discussed in class. 1 Introduction JavaScript is a scripting language produced by Netscape for use within

More information

Lab 2 - Powering the Fubarino. Fubarino,, Intro to Serial, Functions and Variables

Lab 2 - Powering the Fubarino. Fubarino,, Intro to Serial, Functions and Variables Lab 2 - Powering the Fubarino Fubarino,, Intro to Serial, Functions and Variables Part 1 - Powering the Fubarino SD The Fubarino SD is a 56 pin device. Each pin on a chipkit device falls broadly into one

More information

All copyrights reserved - KV NAD, Aluva. Dinesh Kumar Ram PGT(CS) KV NAD Aluva

All copyrights reserved - KV NAD, Aluva. Dinesh Kumar Ram PGT(CS) KV NAD Aluva All copyrights reserved - KV NAD, Aluva Dinesh Kumar Ram PGT(CS) KV NAD Aluva Overview Looping Introduction While loops Syntax Examples Points to Observe Infinite Loops Examples using while loops do..

More information

Introduction to Programming. Writing an Arduino Program

Introduction to Programming. Writing an Arduino Program Introduction to Programming Writing an Arduino Program What is an Arduino? It s an open-source electronics prototyping platform. Say, what!? Let s Define It Word By Word Open-source: Resources that can

More information

Review of the syntax and use of Arduino functions, with special attention to the setup and loop functions.

Review of the syntax and use of Arduino functions, with special attention to the setup and loop functions. Living with the Lab Fall 2011 What s this void loop thing? Gerald Recktenwald v: October 31, 2011 gerry@me.pdx.edu 1 Overview This document aims to explain two kinds of loops: the loop function that is

More information

SPDM Level 2 Smart Electronics Unit, Level 2

SPDM Level 2 Smart Electronics Unit, Level 2 SPDM Level 2 Smart Electronics Unit, Level 2 Evidence Folder John Johns Form 3b RSA Tipton 1.1 describe the purpose of circuit components and symbols. The candidate can describe the purpose of a range

More information

m-block By Wilmer Arellano

m-block By Wilmer Arellano m-block By Wilmer Arellano You are free: to Share to copy, distribute and transmit the work Under the following conditions: Attribution You must attribute the work in the manner specified by the author

More information

Physics 364, Fall 2012, Lab #9 (Introduction to microprocessor programming with the Arduino) Lab for Monday, November 5

Physics 364, Fall 2012, Lab #9 (Introduction to microprocessor programming with the Arduino) Lab for Monday, November 5 Physics 364, Fall 2012, Lab #9 (Introduction to microprocessor programming with the Arduino) Lab for Monday, November 5 Up until this point we have been working with discrete digital components. Every

More information

To lead your students through this activity, you will need your computer, attached to a projector, for projecting your code for students to see.

To lead your students through this activity, you will need your computer, attached to a projector, for projecting your code for students to see. To lead your students through this activity, you will need your computer, attached to a projector, for projecting your code for students to see. STEP 1: PREPARE TO PROGRAM 1. Launch the IDE by clicking

More information

Information Science 1

Information Science 1 Information Science 1 Fundamental Programming Constructs (1) Week 11 College of Information Science and Engineering Ritsumeikan University Topics covered l Terms and concepts from Week 10 l Flow of control

More information