Want to create interactive content? It’s easy in Genially!

Get started free

Compu 4 - Code Blocks

Josep Romagosa Llord

Created on January 6, 2024

Start designing with a free template

Discover more than 1500 professional designs like these:

Math Lesson Plan

Primary Unit Plan 2

Animated Chalkboard Learning Unit

Business Learning Unit

Corporate Signature Learning Unit

Code Training Unit

History Unit plan

Transcript

Code Blocks

Resources

Start

Microbit sensors

Code blocks for reading the light level and temperature in the room
Use case: Shows fire if the temperature is high and a snowflake if its cold.
Use case: Shows a moon if it's dark and a sun if it's daylight.

Led strip

Code blocks for controlling the led strip
Use case: Turn the whole led strip to blue.
Required extension: Neopixel
Use case: Sets the led strip of 30 leds to the pin 0.

Led strip

Code blocks for controlling the led strip
Use case: Turn the led strip into a rainbown pattern.
Use case: Split the led strip into 3 ranges of 10 leads to print Mexico's flag.

Led strip

Code blocks for controlling the led strip
Use case: Shifts to the right by 1 led when pressing B.
Use case: Shifts to the right by 1 led when pressing B.

Gesture

Code blocks for detecting user's gestures
Use case: Shows an arrow pointing to the direction of the user's gesture.
Required extension: Grove

Digital Pin

Code blocks for reading and writing on the Pins
Use case: Turn off a Led light connected to Pin 0 when pressing button A.
Use case: Show a check/cross whether the movement sensor connected to pin 0 is detecting movement or not.
Use case: Turn on a Led light connected to Pin 0 when pressing button B.

Radio

Code blocks for sending and receiving signal between 2 microbits

Received the Signal

Sends the Signal

Receiver Microbit

Sender Microbit

RADIO CHANNEL

Radio (String)

Code blocks for sending and receiving signal between 2 microbits
Use case: Sets the radio channel frecuency (same number on both microbits) to stablish connection.
Use case: Prints an arrow up when the received string is "Up" and a arrow down when the received string is "Down".
Use case: Sends the string value "Up" to the other microbit when pressing A and the string value "Down" when pressing B.

Radio (Number)

Code blocks for sending and receiving signal between 2 microbits
Use case: Sets the radio channel frecuency (same number on both microbits) to stablish connection.
Use case: Prints a check when the received number is 1 and a cross when the received number is 2.
Use case: Sends the value number 1 to the other microbit when pressing A and the value number 2 when pressing B.

Maqueen

Code blocks for controlling the maqueen car kit
Use case: Moves the maqueen at full speed to the direction received by the radio channel.
Required extension: Maqueen

LCD Display

Code blocks for controlling the LCD Display
Required extension: Maqueen