0%

Garett Lim's Coding Projects

Hi, I'm Garett Lim! I enjoy building robots and using coding to solve real-world problems. Starting with block-based coding helped me understand how to control my robots and test new ideas. Later, I wanted to learn something more advanced, so I began using Python. Python showed me how to write my own programs and think in new ways. Combining robotics and Python makes me excited to create projects that can help others and make learning fun. I hope you enjoy seeing what I have built!

Portrait of Garett Lim

Project 1: Ping Pong Racket

Ping Pong Racket

I learnt how to use the LEGO technic parts to create different designs. Using the coding concept of conditionals (if-else), together with different sensors, I coded my designs to do certain actions only if a specific condition is met. Among many other projects, I created a ping pong racket that hits the ball if the touch sensor is activated.

Project 1: Ping Pong Racket
Project 2: Ultrasonic Activated Tractor
Project 2: Ultrasonic Activated Tractor

Ultrasonic Activated Tractor

I built a LEGO-based tractor model designed to simulate real-life functionality. It uses an ultrasonic sensor to detect obstacles and automatically stop when objects are within a threshold distance that I configured. This demonstrates the potential advantages of automation and smart technology in modern farming.

Project 3: Color Activated Shooter

Color Activated Shooter

Having played at the arcade frequently, I decided to use the concepts of conditional statements, colour detection and output controls to create a secure and precise shooter that fires a shot when the colour sensor detects 2 specific colours in the coded order. This project demonstrates how sensor integration and conditional logic can be used to develop automated systems, with potential applications in intelligent defense technologies.

Project 3: Color Activated Shooter
Project 4: Colour and Ultrasonic Automated Car
Project 4: Colour and Ultrasonic Automated Car

Colour and Ultrasonic Automated Car

I decided to create an automated car using LEGO Technic parts that can return to its original parking position after detecting an obstacle. This project simulates the logic behind autonomous parking systems found in modern vehicles. Using the concept of nested while loops with variables, I programmed the car to activate and begin moving when the colour sensor detects a specific colour. While in motion, the car continuously checks for obstacles using the ultrasonic sensor. Once an obstacle is detected, the car automatically stops and reverses back to its starting point—mimicking a vehicle returning to its parking spot. This entire process repeats endlessly, creating a looped simulation of real-world automated vehicle behavior.

Weight Units Converter (weight_units_converter.py)

Description:

In this project, I learned how to convert weight from pounds to kilograms by multiplying by a conversion factor. This is important because it teaches us how to change one unit of measurement to another so we can compare different types of data.

Diagram:

Diagram for Weight Units Converter

Trinket:

Armstrong Checker (armstrong_checker.py)

Description:

I have implemented a Python script named armstrong_no_checker to check if a given number is an Armstrong number. An Armstrong number for a 3-digit number is a number that is equals to the sum of the cubes of its digits. For example, 153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153. This project demonstrates the use of functions, loops, and conditionals in Python to solve mathematical problems. The script prompts the user to enter a number and checks if it is an Armstrong number by calculating the sum of the cubes of its digits and comparing it to the original number.

Diagram:

Diagram for Armstrong Checker

Trinket:

Simple Login System (login_system.py)

Description:

This project is a simple login system that checks if the entered username and password match preset values. If they do, the user is logged in; otherwise, they must try again. It demonstrates how if-else statements handle multiple outcomes based on user input.

Diagram:

login_system.png

Trinket:

Right Triangle Checker (right_triangle_checker.py)

Description:

In this project, I used if-else statements to check if a triangle is right-angled. I asked for three sides, sorted them, and used the Pythagorean theorem to decide if the triangle was right. This is important because if-else lets the program choose different actions based on the input.

Diagram:

Diagram for Right Triangle Checker

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:

Library Inventory (inventory_progression.py)

Description:

In this project, I managed an imaginary library's inventory using a for loop to calculate the number of books on day 20 and the total after 20 days. This project shows how for loops make it easy to perform repetitive tasks.

Diagram:

Diagram for Library Inventory

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:

Number Guessing Game (my_number_guessing_game.py)

Description:

In this project, I built a guessing game using a while loop that keeps asking for a guess until the answer is right. The game tells me if my guess is too high or too low. This is important because while loops let me repeat actions until a condition is met, which is perfect for games.

Diagram:

Diagram for Number Guessing Game

Trinket: