Dance with Ally
This challenge has been written by Kristina Krtalić and is part of the EU CODE WEEK CHALLENGES.

Educational goals
- Coding and Programming Logic:
- students will use Scratch blocks to write event-driven programs that respond to inputs from the micro:bit
- students will understand and apply fundamental programming concepts such as loops, decision, conditionals and variables
- students will build fluency with block-based programming to control digital and physical outputs
- Computational Thinking:
- students will decompose problems into smaller parts and design solutions step by step using Scratch
- students will use sensor data (e.g., buttons, shake) from the micro:bit to control sprites or animations
- students will develop and test algorithms to solve specific challenges (e.g., making the sprite dance when the micro:bit is tilted).
- Problem Solving and Debugging:
- students will engage in iterative design by testing, identifying bugs, and refining their Scratch code and micro:bit interactions
- students will troubleshoot real-time errors involving both software (Scratch scripts) and hardware (micro:bit connection or inputs)
- students will document and reflect on changes made during debugging.
- Creativity and Design Thinking:
- students will create original animations, games, or stories in Scratch that integrate micro:bit inputs as interactive elements
- students will express themselves artistically by choreographing sprite movements or designing interactive scenes
- students will follow the design process: empathize, ideate, prototype, and test
- Collaboration and Communication:
- students will work in pairs or small teams to plan, code, and present interactive projects
- students will explain their design choices and code logic to peers or a broader audience
Duration
60 minutes
Experience
Intermediate - Some basic coding knowledge is recommended; participants should be familiar with fundamental programming concepts.
Target Audience
- Primary School students (6 to 12 years)
- Lower Secondary School students (12 to 16 years)
Purpose
- learn to connect micro:bit with Scratch via Bluetooth
- understand how to use the Scratch micro:bit extension
- use micro:bit buttons to interact with Scratch projects
- create interactive games with micro:bit
- develop problem-solving and logical thinking skills
- enhance creativity through coding
Recommended tool
- computer
- Scratch (https://scratch.mit.edu/)
- Scratch link (https://scratch.mit.edu/download/scratch-link)
- Scratch micro:bit (https://scratch.mit.edu/microbit)
- micro:bit
- sprite Ally (https://codeweek-s3.s3-eu-west-1.amazonaws.com/chatbot/ally.png)
Dance with Ally
Primary School students (6 to 12 years)
Lower Secondary School students (12 to 16 years)
Description
Create a program that will enable simple dance a sprite in Scratch with a micro:bit.
Instructions
- Start Scratch.
- Create an account in Scratch (if you don't have one).
- Start creating a new project, add a sprite, add a background, determine the initial position of the sprite when starting the program.
- Add a group of micro:bit scripts from the Scratch programming language extension.
- Connect the micro:bit to the computer, turn on Bluetooth on the computer (if it is not turned on).
- Install and run Scratch link https://scratch.mit.edu/download/scratch-link, download the micro:bit HEX file and save (copy) it to the micro:bit https://scratch.mit.edu/microbit.
- The micro:bit extension, find a device near the computer by clicking on the orange button in the micro:bit extension.
- Search and find devices.
- Create a program with blocks that will enable a sprite dance to selected music (with the start sound block)) that moves when we shake the micro:bit.
- The dance consists of only two commands: slide on the x-axis left and right. Save the project to your computer.
- After creating the program according to the instructions, students can add their own blocks, determine the sprite's controls by pressing the A and/or B button on the micro:bit, change the sprite`s appearance, change/add movements,...
Examples
- Connecting a micro:bit with Scratch to control a dancing sprite is a great way to explore interactive programming.
- This concept can be extended to various real-life applications and creative projects, such as:
- 1. interactive dance & fitness programs
- use the micro:bit’s accelerometer to track movement and create fitness games
- make a dance learning tool where the sprite follows real-life dance moves
- 2. gesture-based animation & gaming
- control Scratch characters with hand gestures or tilt movements
- develop simple motion-controlled games, like jumping or dodging obstacles






Share the link to your work in your Instagram Bio: tap the Edit Profile button on your Instagram and add the link to your work in the Website field. After that, create a new post, add a screenshot of your work, write “Link in Bio”, add the hashtag #EUCodeWeekChallenge and mention @CodeWeekEU.