Jasper Ting's Coding Projects

My name is Jasper, and I am 12 years old. I started learning robotics with LEGO Mindstorms and block-based coding in Primary 4. I enjoy designing and building robots and structures that automate simple tasks in my daily life. Robotics taught me how to solve real-world problems and motivated me to go beyond block-based coding. This sparked my interest in Python, where I began writing programs to help me solve math problems without using pen and paper.

Portrait of Jasper Ting

Project 1: Catapult

Catapult

I learned how to use LEGO Technic parts to design and build various mechanical structures. By applying coding concepts such as conditionals (if-else) and incorporating different sensors, I programmed my designs to perform specific actions based on real-time input. For example, I created a catapult mechanism that swings to hit the target when the touch sensor is activated—demonstrating how sensor-triggered automation is used in real-world systems that respond to user

Project 1: Catapult
Project 2: Rack And Pinion Door
Project 2: Rack And Pinion Door

Rack And Pinion Door

I enjoy going to the restaurant for sushi and decided to recreate an automated one. Using LEGO Technic parts and a colour sensor, I created a sushi belt that is activated to move only when it detects the colour green. This reduces unnecessary motion and saves energy.

Project 3: Distance Sensor Coin Dispenser

Distance Sensor Coin Dispenser

Inspired by arcade coin dispensers, I applied the design principles and coding skills I learned to build a distance-activated coin dispenser. The dispenser uses two ultrasonic sensors that detect my hand in a specific sequence within a defined distance threshold. When both sensors are triggered in order, the mechanism opens to release coins. This project demonstrates how sensor integration and conditional logic can create automated systems, similar to those used in vending machines.

Project 3: Distance Sensor Coin Dispenser
Project 4: Automated Rabbit Head
Project 4: Automated Rabbit Head

Automated Rabbit Head

My younger siblings loved playing with their toy rabbit head, which spins when the wind hits it. They used to manually spin and stop it, which was fun but limited. To make it more interactive and engaging, I decided to create an automated version of the toy. In this upgraded version, the rabbit head starts spinning automatically as soon as the program runs. When the ultrasonic sensor detects someone nearby—such as a child approaching—the spinning stops, and the toy returns to its original position.

Project 5: Color And Ultrasonic Activated Spinning Top

Color And Ultrasonic Activated Spinning Top

Playing the top is my childhood game and I decided to recreate a sensor-controlled spinning top using LEGO technic parts and coded it to move when it is activated by a color sensor. I could control the direction it spins using an ultrasonic sensor when it detects someone within different range. If the ultrasonic sensor detects someone near it, it will spin clockwise, else, it spins anti-clockwise. This setup mirrors real-life smart devices that respond to environmental cues. The system responds intuitively to human presence, creating an interactive and dynamic user experience.

Project 5: Color And Ultrasonic Activated Spinning Top

Simple Division (simple_division.py)

Description:

This project shows how to calculate the remainder when one number is divided by another. It’s a great way to practice using arithmetic and the modulo operator (%).

Diagram:

simple_division.png

Trinket:

Even/Odd Checker (even_odd_checker.py)

Description:

In this project, I designed a program that checks if a number is even or odd using if-else statements. This project teaches me how to make decisions in code based on conditions.

Diagram:

Diagram for Even/Odd Checker

Trinket:

Prime Number Guesser Game (prime_number_game.py)

Description:

This game challenges you to decide if a number is prime by using if-else statements. It’s a fun way to reinforce the concept of prime numbers and divisibility in code.

Diagram:

prime_number_game.png

Trinket:

Factorial Calculation(factorial_calculator.py)

Description:

I organized a math competition among my friends, and one of the challenges involved calculating the factorial of a given number. I created a Python script that took a user input and calculated the factorial of the given number.

Diagram:

Diagram for Factorial Calculation

Trinket:

Count Vowels and Consonants in a String (count_vowels_consonants.py)

Description:

In this project, I used a for loop to count the number of vowels and consonants in a given string. The loop iterates through each character in the string, checking if it is a vowel or consonant, and updates the counts accordingly.

Diagram:

Diagram for Count Vowels and Consonants

Trinket:

Number Pyramid (number_pyramid.py)

Description:

In this project, I created a number pyramid using nested for loops. The outer loop controls the number of rows, while the inner loop prints the numbers in each row. This project demonstrates how to use loops to create patterns and shapes in Python.

Diagram:

Diagram for Number Pyramid

Trinket: