Micro:bit Variables and Selection Quiz
13 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What formula is used for converting Celsius to Fahrenheit?

  • °F = 1.8°C + 32 (correct)
  • °F = 2°C + 32
  • °F = 1.8°C - 32
  • °F = 0.5556°C + 32

What is essential to do before using radio channels?

  • Set the radio group and channel (correct)
  • Activate all frequencies
  • Calibrate the sensors
  • Restrict access to only one user

What should you do to determine the effective range of the radio?

  • Use a formula for range calculation.
  • Estimate to the nearest 50cm. (correct)
  • Count the number of users.
  • Measure in inches.

When creating a radio channel, how many unique channels can you choose from?

<p>1 – 255 (A)</p> Signup and view all the answers

What is a common tool for sending and receiving over a radio channel?

<p>An emulator (B)</p> Signup and view all the answers

What is a key characteristic of variables in programming?

<p>They can change values during program execution. (D)</p> Signup and view all the answers

Which of the following statements is true about the use of names for variables?

<p>Variable names should be meaningful for clarity. (D)</p> Signup and view all the answers

In an if/else statement, which condition is evaluated first?

<p>The if condition. (C)</p> Signup and view all the answers

What is the primary role of inputs in a micro:bit program?

<p>To change the output of the program during execution. (A)</p> Signup and view all the answers

How does a micro:bit's light sensor function?

<p>It converts light energy into an electrical signal. (D)</p> Signup and view all the answers

What is the purpose of Analogue to Digital Conversion (ADC) in sensing?

<p>To convert physical signals into numerical measurements. (C)</p> Signup and view all the answers

If a microphone sensor can detect 4 different sound levels using 2 wires, how many can it detect with 3 wires?

<p>8 (C)</p> Signup and view all the answers

What happens to the else and else if conditions within an if/else statement when the if condition is true?

<p>They are ignored. (C)</p> Signup and view all the answers

Flashcards

Fahrenheit (°F)

A unit of measurement for temperature that is commonly used in the United States.

Celsius (°C)

A unit of measurement for temperature that is commonly used in most of the world.

Radio

A wireless communication technology that allows devices to transmit and receive data over radio waves.

Radio Channel

A specific frequency used by a radio transmitter and receiver to send and receive data.

Signup and view all the flashcards

Radio Group

A group of radio devices that communicate over a common frequency.

Signup and view all the flashcards

What is a variable?

A variable is a named container that stores a value, which can be either a number or a text string. Its value can change during the program's execution.

Signup and view all the flashcards

Why should variables have meaningful names?

A variable name should be descriptive and meaningful, making it easy to understand what data it holds in the code.

Signup and view all the flashcards

What are selection statements used for?

Selection statements, such as 'if/else if/else', allow the program to make decisions based on conditions. Only the code block corresponding to the first true condition is executed.

Signup and view all the flashcards

What are inputs?

Inputs are sources of data that can change the program's behavior during execution. They can be button presses, sensor readings, etc.

Signup and view all the flashcards

How do sensors work?

Sensors convert physical phenomena, like light or temperature, into electrical signals that can be represented as numbers. The Micro:bit often uses a range of 0-255.

Signup and view all the flashcards

What is Analogue to Digital Conversion (ADC)?

Analogue to Digital Conversion (ADC) converts continuous signals from sensors into discrete digital values that computers can understand.

Signup and view all the flashcards

How is sensor data gathered?

Sensors gather data through a specific set of instructions within the program, often called an 'input library'.

Signup and view all the flashcards

How does a light sensor work?

Light sensors use light energy to change an electrical signal, which is then converted into a numerical value by the ADC. This process allows the computer to understand the intensity of light.

Signup and view all the flashcards

Study Notes

Micro:bit Revision Guide for Assessment

  • The assessment includes a practical element requiring coding tasks.
  • Refer to your OneNote for specific tasks.
  • Complete tasks in the makecode editor.

Variables

  • Variables are assigned a value, given a descriptive name, and can store numbers or text.
  • Variables can change throughout a program.

Using Variables

  • Variables can be assigned a starting value.
  • The value can be accessed and displayed within a loop.
  • Variable names should be meaningful for better understanding.

Selection (if/else)

  • Selection uses if/else if/else statements.
  • The first true condition activates the associated block of code.
  • Else if and else conditions are skipped if a preceding condition is true.
  • Conditions must evaluate to true or false.

Testing Multiple Conditions

  • Multiple conditions can be combined in an ’if’ statement using the ‘and’ operator.

Inputs

  • Inputs change a program's execution (e.g., button presses, sensor readings).
  • Inputs affect program output.
  • Programs actively listen for input changes.

Inputs: Sensors

  • Sensors transform natural phenomena into numerical electrical signals.
  • Sensor data range is typically 0-255 for the micro:bit.
  • Sensors are used to measure phenomena such as light level or sound intensity.
  • Data is collected/analysed using the input library.

Sensing the Real World

  • Light sensors convert light energy into electrical signals.
  • Analog to Digital Conversion (ADC): Translates physical levels into numbers.

Sound Levels

  • Computers represent sound levels with numbers.
  • Increasing wires connected to the microphone increase the level of detected sound wave amplitudes.

Math

  • Ensure you are proficient with numerical calculations related to your sensor data.

Converting Celsius to Fahrenheit

  • The formula to convert Celsius to Fahrenheit is: °F = 1.8°C + 32

Radio

  • Learn how to create and use radio channels on the micro:bit.
  • Emulators are helpful as tools.
  • Refer to accompanying slides and tasks in OneNote.

Different Radio Channels

  • Radio channels rely on different frequencies.
  • Setting the same radio group makes them use the same frequency.
  • Channels range from 1 to 255.

Sending and Receiving Data

  • Set the radio channel and sending of data (e.g., button presses).
  • Indicate receipt of data and display it (e.g., on screen).

Radio Range

  • Determine the range of the micro-bit's radio transmission/reception (approximately 50cm).

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Description

Test your knowledge on using variables and selection statements in Micro:bit programming. This quiz covers variable assignments, meaningful names, and the if/else structure essential for coding tasks. Prepare for your assessment by mastering these concepts.

More Like This

Use Quizgecko on...
Browser
Browser