1 / 16

Global Challenge Night Sensor Lesson 2

In this lesson, you will create a Night Sensor, a wearable device for children's road safety at night. Learn decomposition, algorithms, iteration, loops, and selection with pseudocode and flowcharts to ensure safety. Test and debug algorithms.

khancock
Download Presentation

Global Challenge Night Sensor Lesson 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Global Challenge Night Sensor Lesson 2

  2. What are the main challenges around road safety for children at night? What was your favourite technology device idea from last lesson and why?

  3. Your challenge: • create a Night Sensor: • a wearable device that will give an audio and visual reminder to a child to ‘be safe, be seen!’ at night.

  4. Decomposition • breaking down a complex problem into smaller, component parts. Algorithm • a sequence of instructions or rules to solve a problem • written for a person to follow to write code

  5. Learning objectives: • To decompose a large problem into smaller, component parts • To write a detailed, accurate algorithm using pseudocode and flowcharts • To include iteration, loops and selection in algorithms • To test and debug algorithms and understand why this is important

  6. Your challenge: • create a Night Sensor: • a wearable device that will give an audio and visual reminder to a child to ‘be safe, be seen!’ at night.

  7. Night sensor basic algorithm • Start • Sense if dark • If dark then • Make audio sound • Display visual message • Stop • Otherwise, repeat

  8. Pseudocode • A simple way of describing a set of instructions (an algorithm) • No specific syntax (programming language)

  9. Night sensor pseudocode algorithm 1 • START • INPUT sense darkness level • IF dark then • OUTPUT musical audio for 5 seconds • OUTPUT visual display ‘Be safe, be seen!’ • STOP • ELSE, REPEAT

  10. Night sensor pseudocode algorithm 2 • When START button pressed • OUTPUT ‘on’ audio sound • INPUT Sense IF dark • IF dark then • OUTPUT musical audio sound for 5 seconds • OUTPUT visual display ‘Be safe, be seen!’ • ELSE, do nothing • When stop button pressed • OUTPUT ‘off’ sound • STOP

  11. Input device • hardware that sends data to a computer system Output device • hardware that communicates the results of processed data from a computer system to the outside world

  12. Iteration • The repetition of a sequence Loops • A form of iteration • repeat until a certain condition is met Selection • a decision to be made according to whether a condition is met • If, then, else

  13. Flowchart symbols Input / Output Start / Stop Decision Process Direction of flow

  14. Start Night sensor flowchart • START • INPUT sense darkness level • IF dark then • OUTPUT musical audio for 5 seconds • OUTPUT visual display ‘Be safe, be seen!’ • STOP • ELSE, REPEAT Input sense darkness level Is it dark? No Yes Output audio music 5 seconds Output visual display ‘Be safe, be seen!!’ Stop

  15. Wrap up questions: • How have you used decomposition today? • Why have we spent time designing algorithms today before starting to code? • How have you used iteration and loops today? • How have you used selection today? • How will pseudocode and/or flowcharts help you code? • Why has it been helpful to test and revise the algorithms today?

  16. Learning objectives: • To decompose a large problem into smaller, component parts • To write a detailed, accurate algorithm using pseudocode and flowcharts • To include iteration, loops and selection in algorithms • To test and debug algorithms and understand why this is important

More Related