The code used in the micromouse

The code uploaded to the micromouse gives it a couple of modes, it is designed to run on a Raspberry Pi Pico microcontroller. We have the combat mode, obstacle avoidance mode, and white line detection. Initially, the program sets up hardware configuration and declares GPIO pins for white line sensors (two in the front and one in the rear) to detect the limits. In addition, infrared sensors (IR) are used to detect obstacles and avoid them. It is important to have these sensors for autonomous movement, without hitting any obstacles. Moving forward, the program integrates multiple sensors through the GPIO pin.

Our program has a special feature, which is LEDs lighting up when the micromouse hits something. For this feature, we will be using 20 LEDs surrounding the micromouse which are going to be flashing as required.

In terms of movement and navigation, the code defines a suit of functions that controls the motor’s forward, reverse, and turning motion in addition to other actions. These functions detect signals for precise control over the motor speed which allows the robot to execute a variety of maneuvers. The integration of sensor feedback into the control functions allows the robot to modify its behavior based on real-time data. For example, it can adjust its course upon detecting an obstacle or line boundary.

Moving forward, the program has provisions for more advanced strategies, such as attacking when specific conditions are met or evading upon detecting a threat from specific directions.

Overall, our code for the micromouse robot has a robust set of abilities for autonomous operation, emphasizing sensor, integration, real time speed control, and finally the adaptive behavior. Thanks to our program, our micromouse robot is ready and prepared to navigate in complex environments and engage in strategic interactions.

Scroll to Top