MoonCampaign by Ved (13 years)
Our Social Impact - We're transforming education globally with free robotics and math workshops in the US, UK,
Canada, and Australia.
Our workshops have helped 66,000 students alone in the US plus 14,000 students benefit from our four-week sessions.
Ball Bouncing Animation
Ved
Show and Tell
Show n Tell
Coming Soon
Ved’s Ball Bouncing Animation on the Micro:bit is a creative and visually engaging project. Using Python, Ved programmed the Micro:bit to simulate a ball bouncing around the LED screen. The animation uses loops and conditional statements to move the ball across the display, changing direction when it reaches the edges. This project is a fun way to explore animation and coding on the Micro:bit , showcasing how simple code can create dynamic visuals.
Animation has always fascinated me, and I wanted to bring that excitement to the Micro:bit. My Ball Bouncing Animation project simulates a ball moving around the LED screen, bouncing off the edges as if it’s in a tiny box. Using Python, I programmed the Micro:bit to display a single LED as the ball and move it across the screen using loops and conditional statements. When the ball reaches the edge of the display, it changes direction, creating the illusion of bouncing. It’s a simple yet captivating way to explore animation and coding.
The code works by defining the ball’s position using variables for its x and y coordinates. A loop continuously updates the ball’s position, moving it one step at a time. Conditional statements check if the ball has reached the edges of the screen, and if so, the direction is reversed. The display.set_pixel function is used to turn on the LED at the ball’s current position, while the previous position is turned off to create the illusion of movement. It’s amazing how a few lines of code can create such a dynamic and engaging animation.
In the future, I’d like to expand this project by adding more features, such as multiple balls bouncing simultaneously or changing the ball’s speed based on user input. I’m also thinking about adding sound effects or creating a game where the player interacts with the bouncing ball. The possibilities are endless, and I’m excited to see how this project can evolve!
©️ Copyright, Moonpreneur Inc.
3031 Tisch Way, 110 Plaza West PMB # 138, San Jose, CA 95128, USA
Likes
Rating
42 days left
Ball Bouncing Animation