+ All Categories
Home > Documents > WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and...

WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and...

Date post: 04-Jun-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
15
WAG THE DOG 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 production skills Investigating and defining purposeful definition and decomposition of complex problems in terms of functional and non-functional requirements - 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. Estimated Effort: 140 Mins Value: 15% Components List: Arduino Board USB Cable Jumper Wires Ultrasonic Sensor Breadboard SG90 Servo Motor PIR Sensor Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1
Transcript
Page 1: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

WAG THE DOG

EXPLOREWALT: 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 production skills

Investigating and defining

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

- 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.

Estimated Effort: 140 MinsValue: 15%Components List:

Arduino Board

USB Cable

Jumper Wires Ultrasonic Sensor

Breadboard SG90 Servo Motor PIR Sensor

Item 17: Wag the DogMonday, 15 October 2018 12:34 PM

Physical Computing and Embedded Sytems Page 1

Page 2: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

Servos - have a rotational range of 180°. We can send a command to a servo from our Arduino to tell it to go to a specific angle.

Passive Infrared (PIR) Detector - these are just like the ones you’ll find in alarm systems. They detect movement using infrared light, which is invisible to the naked eye. They can’t tell the difference between fast or slow moving objects, but simply say “hey, we detect some movement”. By doing this, we can start th e servo movement only when motion is detected. It will run for a few seconds, then stop. After a few seconds, if you start moving again, the PIR will pick up the movement and the servo motor will move again for a period.

Want More?Read https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/overview

Read https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/how-pirs-work

Read Item 12 for all things Ultrasonic Sensor

Read Item 13 for all things Breadboard

The Circuit:

Physical Computing and Embedded Sytems Page 2

Page 3: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

Algorithms: Sequence, selection and iterationCode 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 <https://www.arduino.cc/reference/en/language/variables/data-types/int/>

Long [Data Types]

Description

Long variables are extended size variables for number storage, and store 32 bits (4 bytes), from -2,147,483,648 to 2,147,483,647.

If doing math with integers, at least one of the numbers must be followed by an L, forcing it to be a long. See the Integer Constants page for details.

Syntax

long var = val;

var - the long variable name val - the value assigned to the variable

Example Code long speedOfLight = 186000L; // see the Integer Constants page for explanation of the 'L'

From <https://www.arduino.cc/reference/en/language/variables/data-types/long/>

byte Data Types]

Description

A byte stores an 8-bit unsigned number, from 0 to 255.

From <https://www.arduino.cc/reference/en/language/variables/data-types/byte/>

micros() [Time]

Description

Returns the number of microseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after

approximately 70 minutes. On 16 MHz Arduino boards (e.g. Duemilanove and Nano), this function has a resolution of four microseconds (i.e. the value

returned is always a multiple of four). On 8 MHz Arduino boards (e.g. the LilyPad), this function has a resolution of eight microseconds.

Syntax

time = micros()

Physical Computing and Embedded Sytems Page 3

Page 4: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

time = micros()

Parameters

Nothing

Returns

Returns the number of microseconds since the Arduino board began running the current program.(unsigned long)

From <https://www.arduino.cc/reference/en/language/functions/time/micros/>

while [Control Structure]

Description

A while loop will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable,

or the while loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor.

Syntaxwhile(condition) // statement(s)

The condition is a boolean expression that evaluates to true or false.

Example Codevar = 0;while(var < 200) // do something repetitive 200 times var++;

From <https://www.arduino.cc/reference/en/language/structure/control-structure/while/>

if [Control Structure]

Description

The if statement checks for a condition and executes the proceeding statement or set of statements if the condition is 'true'.

Syntaxif (condition) //statement(s)

Parameters

condition: a boolean expression i.e., can be true or false

From <https://www.arduino.cc/reference/en/language/structure/control-structure/if/>

return [Control Structure]

Description

Terminate a function and return a value from a function to the calling function, if desired.

Syntaxreturn;return value; // both forms are valid

Parameters

value: any variable or constant type

Example Code

A function to compare a sensor input to a thresholdint checkSensor()

if (analogRead(0) > 400) return 1; else return 0;

The return keyword is handy to test a section of code without having to "comment out" large sections of possibly buggy code.

From <https://www.arduino.cc/reference/en/language/structure/control-structure/return/>

Physical Computing and Embedded Sytems Page 4

Page 5: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

From <https://www.arduino.cc/reference/en/language/structure/control-structure/return/>

Servo library This library allows an Arduino board to control RC (hobby) servo motors. Servos have integrated gears and a shaft that can be precisely controlled. Standard servos allow the shaft to be positioned at various angles, usually between 0 and 180 degrees. Continuous rotation servos allow the rotation of the shaft to be set to various speeds.

The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega. On boards other than the Mega, use of the library disables analogWrite() (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins. On the Mega, up to 12 servos can be used without interfering with PWM functionality; use of 12 to 23 motors will disable PWM on pins 11 and 12.

Circuit

Servo motors have three wires: power, ground, and signal. The power wire is typically red, and should be connected to the 5V pin on the Arduino board. The ground wire is typically black or brown and should be connected to a ground pin on the Arduino board. The signal pin is typically yellow, orange or white and should be connected to a digital pin on the Arduino board. Note that servos draw considerable power, so if you need to drive more than one or two, you'll probably need to power them from a separate supply (i.e. not the +5V pin on your Arduino). Be sure to connect the grounds of the Arduino and external power supply together.

ExamplesKnob: Control the position of a servo with a potentiometer.•Sweep: Sweep the shaft of a servo motor back and forth.•

Functionsattach()•

write()•

writeMicroseconds()•

read()•

attached()•

detach()•

From <https://www.arduino.cc/en/Reference/Servo>

Want More?http://playground.arduino.cc/ComponentLib/servo

HOW TO SET UP AN ARDUINO LIBRARY :: VIDEO #1 :: ARDUINO LIBRARY SERIES

UNDERSTANDING AN ARDUINO LIBRARY :: VIDEO #2 :: ARDUINO LIBRARY SERIES

https://www.hackster.io/Kub_Luk/using-serial-monitor-to-control-servo-motor-cc1daf

#include [Further Syntax]

Description

#include is used to include outside libraries in your sketch. This gives the programmer access to a large group of standard C libraries (groups of pre-made

functions), and also libraries written especially for Arduino.

The main reference page for AVR C libraries (AVR is a reference to the Atmel chips on which the Arduino is based) is here.

Note that #include, similar to #define, has no semicolon terminator, and the compiler will yield cryptic error messages if you add one.

Example Code

This example includes a library that is used to put data into the program space flash instead of ram. This saves the ram space for dynamic memory needs and

makes large lookup tables more practical.#include <avr/pgmspace.h>prog_uint16_t myConstants[] PROGMEM = 0, 21140, 702 , 9128, 0, 25764, 8456,0,0,0,0,0,0,0,0,29810,8968,29762,29762,4500;

From <https://www.arduino.cc/reference/en/language/structure/further-syntax/include/>

#define [Further Syntax]

Description

#define is a useful C component that allows the programmer to give a name to a constant value before the program is compiled. Definedconstants in arduino

don’t take up any program memory space on the chip. The compiler will replace references to these constants with the defined value at compile time.

This can have some unwanted side effects though, if for example, a constant name that had been #defined is included in some other constant or variable

name. In that case the text would be replaced by the #defined number (or text).

In general, the const keyword is preferred for defining constants and should be used instead of #define.

Syntax#define constantName value

Note that the # is necessary.

Example Code#define ledPin 3// The compiler will replace any mention of ledPin with the value 3 at compile time.

Notes and Warnings

There is no semicolon after the #define statement. If you include one, the compiler will throw cryptic errors further down the page.

Physical Computing and Embedded Sytems Page 5

Page 6: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

There is no semicolon after the #define statement. If you include one, the compiler will throw cryptic errors further down the page.#define ledPin 3; // this is an error

Similarly, including an equal sign after the #define statement will also generate a cryptic compiler error further down the page.#define ledPin = 3 // this is also an error

From <https://www.arduino.cc/reference/en/language/structure/further-syntax/define/>

How Libraries WorkThe Arduino Language is a variant of C++ which supports Object Oriented Programming (OOP). This can be thought of as other co de that is located outside our code, but we can use it as if it is within our code. This means that instead of writing a whole heap of code to orientate a servo shaft at a certain degree and spin for a set amount of time at a set speed, we can just call the function within the library that does this.These libraries are actually classes in OOP. For more on classes, see:

https://learn.adafruit.com/multi-tasking-the-arduino-part-1/a-classy-solutionhttps://blog.udemy.com/arduino-tutorial-learn-the-basics/#9_8

If we use the Servo library as an example, it has the following functions or methods:

Standard Methodsattach(int) - Turn a pin into a servo driver. Calls pinMode. Returns 0 on failure.detach() - Release a pin from servo driving.write(int) - Set the angle of the servo in degrees, 0 to 180.read() - return that value set with the last write().attached() - return 1 if the servo is currently attached.

Extra Methodsrefresh() - You must call this at least once every 50ms to keep the servos updated. You can call it as often as you like, it won't fire more than once every 20ms. When it does fire, it will take from .5 to 2.5 milliseconds to complete, but won't disable interrupts.setMinimumPulse(uint16_t) - set the duration of the 0 degree pulse in microseconds. (default minimum value is 544 microseconds)setMaximumPulse(uint16_t) - set the duration of the 180 degree pulse in microseconds. (default maximum pluse value is 2400 microsconds)

From <http://playground.arduino.cc/ComponentLib/servo>

So, we don't need to know how these functions are coded, we just need to know which ones to use. This is pretty much the same as the other Arduino functions that you regularly use. For example, when you use pinMode(), you probably don’t stop to think that this is a function that has its own code and what the code may be.

However, library functions are a bit different as you can't just call them like you can call and use pinMode() or digitalWrite(). To use the functions or methods within a library (class), you must first include (tell the code that you will be using the library and its functions) them in your code and then create an Object (or Instance of the class). For example, to create a Servo object (instance of the Servo class) called servo1 is created with:

#include <Servo.h>Servo servo1; // this is similar to declaring a variable.

Now, when we want to use the write() method, we use dot notation like this:

servo1.write(0)

So, instead of calling or using the write() function outright, we declare that we want to use the write() function that is within the Servo library or class; as an instance called servo1.

Note: Make sure you use the servo below as these are standard 180 degree ones.

Continuous MotorsIn your kit, these are like the ones below. Don't use these! They have 360 written on the side

Physical Computing and Embedded Sytems Page 6

Page 7: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

In your kit, these are like the ones below. Don't use these! They have 360 written on the side

CodingContinuo...

Want More?

Working with motors: servo motors

From <https://www.element14.com/community/community/arduino/arduino-tutorials/blog/2016/04/01/working-with-motors-servo-motors>

Coding Tips

/* CutOuts-1ServoPlusPIRAndUS - 15/May/2018* PIR o/p goes high when movement sensed.* Rate of movement changes (faster or slower) as object gets closer. Unicorn slows, dog tail goes faster.* * Set PIR lhs (with dome uo and looking at pots) pot to fully ccw for short timeout to give 3 back/forth cycles for 1 motion detection. Set rhs pot to midway. This is sensitivity adjustment.*/

#include <Servo.h> //we will be using functions, such as attach() and write() from the Servo library

#define sketchName "Cutouts-1ServoPlusPIRAndUS" // give your sketch a name

#define echoPin 6 // define a constant variable called echoPin and assign the value 6#define trigPin 7#define servo1Pin 9#define pirPin 10

#define servo1Pos1 50 //change these for 'wag' position in degrees#define servo1Pos2 90

Servo servo1; // create a servo object (instance of Servo library), called servo1 to control the servo.

int currentDistance;int previousDistance;

/****************************/

void usonicSetup(void) // setup ultrasonic sensor pins pinMode(echoPin, INPUT); pinMode(trigPin, OUTPUT); digitalWrite(trigPin, LOW); // End of usonicSetup()

/****************************/// measure the distance based on sensor valueslong usonicMeasureDistance(long utimeout) // utimeout is maximum time to wait for return in microseconds long echoTime, utimer; if (digitalRead(echoPin) == HIGH) return 0; // If echo line is still low from last result, return 0; digitalWrite(trigPin, HIGH); //send trigger pulse delay(1); digitalWrite(trigPin, LOW); utimer = micros(); // number of microseconds since the Arduino board began running the current program while((digitalRead(echoPin) == LOW) && ((micros() - utimer) < 1000)) // Wait for pin state to change. return starts after 460us typically or timeout (eg if not connected) utimer = micros(); while((digitalRead(echoPin) == HIGH) && ((micros() - utimer) < utimeout)) // Wait for pin state to change

Physical Computing and Embedded Sytems Page 7

Page 8: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

while((digitalRead(echoPin) == HIGH) && ((micros() - utimer) < utimeout)) // Wait for pin state to change echoTime = micros() - utimer; if (echoTime == 0) echoTime = utimeout; return echoTime; //Terminate a function and return a value from a function to the calling function - currentDistance // End of usonicMeasureDistance()

/****************************/

void setup()

Serial.begin(115200); Serial.print(sketchName); Serial.println(" running...");

pinMode(pirPin, INPUT); servo1.attach(servo1Pin); // Attach the servo to pin 9 Serial.println("Resetting servo..."); servo1.write(0); //Set the angle of the servo to 0 degrees, ie starting position

usonicSetup(); // Set up the ultrasonic sensor, by calling function above

// End of setup()

/****************************/

void loop()

byte counter; // A byte stores an 8-bit unsigned number, from 0 to 255 if (digitalRead(pirPin) == HIGH) // PIR movement detection triggers servo movement Serial.println("Movement detected"); for (counter = 0; counter < 3; counter++) // 3 loops through currentDistance = usonicMeasureDistance(11600) / 58; // Distance in cm, time out at 11600us or 2m maximum range

if ((currentDistance > 0) && (currentDistance < 180) && (currentDistance != previousDistance)) // If closer than 180 cms and has moved Serial.print("Object detected at "); Serial.print(currentDistance); // Show distance in cm's Serial.println("cm's"); // Serial.print("servo1Pos1 = ");// Serial.println(servo1Pos1); servo1.write(servo1Pos1); // Tell servo to go to position in variable 'servo1Pos1'; see #define above for values delay(10 * currentDistance); // Delay decreases as object gets closer therefore servo goes faster. // Serial.print("servo1Pos2 = "); // Serial.println(servo1Pos2); servo1.write(servo1Pos2); // Tell servo to go to position in variable 'servo1Pos2' delay(10 * currentDistance); // Delay decreases as object gets closer therefore servo goes faster. // End of loop()

/****************************/

INSTRUCTIONS- You can choose the dog, unicorn or your own image.

build_3_dog

Dog

Unicorn

build_3_unicorn

Resources Download

diyode_013_kidsbasic...

Offline copy of Instructions

Kid'sBasics_ Se...

BUILD 1: SERVO MOTORLink to instructions: https://diyodemag.com/projects/kids_basics_sensors_and_servos

Assemble and test Build 1 to make sure you know How servos work. Don't worry about using the drawings or even the breadboard. Make sure you use this servo:

Physical Computing and Embedded Sytems Page 8

Page 9: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

> Use this code:

kids_basics_build_1

> If all goes well, you should have the servo spinning one way (50 degrees) and then the opposite direction (490 degrees) the next.

BUILD 2: PASSIVE INFRARED DETECTORS

- Assemble Build 2 to make sure you know how Passive Infrared Detectors (PIDs) work. Don't worry about using the drawings, but you will need to use the breadboard for the 5V connections.

Physical Computing and Embedded Sytems Page 9

Page 10: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

> Use this code:

kids_basics_build_2

> if all goes well, the servo should move when movement is detected. Keep an eye on the serial monitor.

3. BUILD 3: ULTRASONIC SENSORS

* PIR o/p goes high when movement sensed.* Rate of movement changes (faster or slower) as object gets closer. Unicorn slows, dog tail goes faster.* * Set PIR lhs (with dome uo and looking at pots) pot to fully ccw for short timeout to give 3 back/forth cycles for 1 motion detection. Set rhs pot to midway. This is sensitivity adjustment.*/

- Build and document BUILD 3 ULTRASONIC SENSORS: https://diyodemag.com/projects/kids_basics_sensors_and_servos

INSTRUCTIONS1. Connect 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.2. Answer these questions:

Portfolio Task Questions for EXPLORE1. Define how each of the components work? Identify each component and describe how they work with text and images.

2. Identify what and where components are plugged into the GPIO. Why there?

3. Describe How the circuit works? Tell the story. Include a picture.

[ use https://www.tinkercad.com/ ]

DEVELOPWALT: design and evaluation of user experiences and algorithms

WILF

Physical Computing and Embedded Sytems Page 10

Page 11: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

WILFDesign

> Analyse to identify where input, output, processing and storage occurs in the code.> translated code into pseudocode

- interpret existing code:

- Plan to modify parts of the code to make it work differently or more effectively

Evaluation- Recommended ways to use the technology differently.

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 production skills

Generating and designing - producing and implementing

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.

1. Save the sketch (code) below and then open in the Arduino IDE (File>Open..)

kids_basics_build_3

2. Copy the code into a place where you can edit it to add comments.3. Answer the following:

Portfolio Task Questions for DEVELOP1. Where are the Input, output, storage in the code?

Feature Code Description

2. How does the code work - pseudocode

a. Copy the existing code

b. Place comments (//) next to each line of code in pseudocode

3. 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 pseudocodeOperation Pseudocode Programming equivalent

Accepting inputs Prompt user for surnameInput surname

var person = prompt("Please enter your name");

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 IF mark is greater than 49 THEN print PassELSE print Fail

if (mark > 49) console.log(“Pass”);

else console.log(“Fail”);

Iteration or Repeating operations

1. Pre-test loop — also known as the WHILE loop

WHILE total greater than 0 subtract new purchase from totalENDWHILE

while (total > 0) total = total - new_purchase;

Iteration or Repeating operations

2. Post-test loop — eg the REPEAT/UNTIL or DO/WHILE loops

REPEAT <Block>UNTIL condition

var i = 0;do text += "The number is " + i;

Physical Computing and Embedded Sytems Page 11

Page 12: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

2. Post-test loop — eg the REPEAT/UNTIL or DO/WHILE loops UNTIL condition text += "The number is " + i; i++;while (i < 5);

Iteration or Repeating operations

3. Counting loop — also known as the FOR loop.

FOR Index = START_VALUE to FINISH_VALUE <Block>

ENDFOR

var i;for (i = 0; i < cars.length; i++) text += cars[i] + "<br>";

GENERATEWALT: 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

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 production skills

Generating and designing - producing

and implementing

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 object-oriented program, using algorithms and data structures involving modular functions that reflect the relationships of real-world data and data entities

- Most code implemented

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

- Some code implemented

INSTRUCTIONS1. Set up the circuit. Take a photo for your portfolio, or set up a virtual circuit in tinkercad and take a screenshot.2. Answer the questions below:

Portfolio Task Questions for GENERATE1. Get the hardware and software working

2. Get your modifications working and highlight where you have altered the code. document

3. Record a very short video of your working solution.

Physical Computing and Embedded Sytems Page 12

Page 13: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

Code:

Wag_The_Dog

Youtube Video: https://youtu.be/ExiUOZXoRqY

Things you can change- triggering distances for ultrasonic sensor- angle of 'wag'

EVALUATE AND REFINEWALT: 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

Physical Computing and Embedded Sytems Page 13

Page 14: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

- Makes judgments about ideas, works, solutions or methods in relation to risk, sustainability and potential for innovation and enterprise

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 production skills

Evaluating

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 REFINE1. Update your kanban and burndown chart

2. 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?

Why not add a speaker and have a scream

Resources

scream_low

Build instructions 2 copies of "the scream"

https://learn.adafruit.com/assets/58185

Play .wav files on Arduino without an SD card

https://www.arduino.cc/en/Tutorial/SimpleAudioPlayer

Other Projects you can do now!

https://blog.adafruit.com/2018/06/18/arduino-trash-bot/

https://www.hackster.io/will-su/touchless-automatic-motion-sensor-trash-can-bbeed1?use_route=project

https://www.hackster.io/hassanshettimal/motion-detection-alarm-system-c5fdd5

https://randomnerdtutorials.com/arduino-with-pir-motion-sensor/

https://diyodemag.com/projects/follow_the_leader

Other Projects with servos from "THE ARDUINO INDENTOR’S GUIDE, LEARN ELECTRONICS BY MAKING 10 AWESOME PROJECTS", by SparkFun Electronics, 2017, BRIAN HUANG and DEREK RUNBERG:

6 Balance Beam, pg 254•8 Drawbot, The Robotic Artist, pg 346•

Other Projects with Breadboards

from "THE ARDUINO INDENTOR’S GUIDE, LEARN ELECTRONICS BY MAKING 10 AWESOME PROJECTS", by SparkFun Electronics, 2017, BRIAN HUANG and DEREK RUNBERG:

Physical Computing and Embedded Sytems Page 14

Page 15: WAG THE DOG · Item 17: Wag the Dog Monday, 15 October 2018 12:34 PM Physical Computing and Embedded Sytems Page 1 . Servos - have a rotational range of 180°. We can send a command

2 A Stoplight for Your House, pg 99•3 The Nine-Pixel Animation Machine, pg 138•4 Reaction Timer, pg 176•5 A Color-Mixing Night-Light, pg 213•10 Tiny Electric Piano, pg 422•

Arduino Starter Kit Projects you can make:01 GET TO KNOW YOUR TOOLS an introduction to the basics•

02 SPACESHIP INTERFACE design the control panel for your starship•

03 LOVE-O-METER measure how hot-blooded you are•

04 COLOR MIXING LAMP produce any color with a lamp that uses light as an input•

05 MOOD CUE clue people in to how you're doing•

06 LIGHT THEREMIN create a musical instrument you play by waving your hands•

07 KEYBOARD INSTRUMENT play music and make some noise with this keyboard•

08 DIGITAL HOURGLASS a light-up hourglass that can stop you from working too much•

09 MOTORIZED PINWHEEL a colored wheel that will make your head spin•

10 ZOETROPE create a mechanical animation you can play forward or reverse•

11 CRYSTAL BALL a mystical tour to answer all your tough questions•

12 KNOCK LOCK tap out the secret code to open the door•

13 TOUCHY-FEEL LAMP a lamp that responds to your touch•

14 TWEAK THE ARDUINO LOGO control your personal computer from your Arduino•

15 HACKING BUTTONS create a master control for all your devices!•

Once you’ve mastered this knowledge, you’ll have a palette of software and circuits that you can use to create something beautiful, and make someone smile with what you invent. Then build it, hack it and share it. You can find the Arduino code for all these projects within the Arduino IDE, click on File / Examples / 10.StarterKit.Have a look at these video tutorials for a project by project walk-through.

From <https://store.arduino.cc/usa/arduino-starter-kit>

Physical Computing and Embedded Sytems Page 15


Recommended