Code1.png

We did all our coding on Arduino. We did them all separately according to the different steps, that is, for the voice, the collision sensor, the LEDs, the LCD screen, the weight sensor, and the motors.This code snippet includes several libraries and defines constants and variables for various sensors and components. It sets up connections for sound, collision, and load sensors, as well as an OLED display. The specific functionalities include monitoring sound levels, detecting collisions, and checking the load level, while utilizing the Adafruit SSD1306 library for controlling the OLED display. The pin assignments and threshold values for each sensor are also specified in this part of the code.

Portable Network Graphics (PNG) - 39.49 kB - 01/11/2024 at 19:19

Preview
Download

Code2.png

The setup() function configures the initial settings of the program. It declares pins for components such as sound, collision, and load, initializes serial ports, and sets up the OLED display. Additionally, it initializes default values and briefly displays a startup screen on the OLED display. In summary, this part establishes the initial conditions and connections required for the proper functioning of the program.

Portable Network Graphics (PNG) - 44.53 kB - 01/11/2024 at 19:20

Preview
Download

Code3.png

The loop() function in the code continuously monitors sound, collision, and load sensors. For the sound sensor, it turns on an LED if the sound level exceeds a predefined threshold. For the collision sensor, it activates an LED when the sensor is triggered. Regarding the load sensor, it illuminates an LED if the load level surpasses a specific threshold. Detection states are continuously updated. In summary, this continuous loop monitors and responds to changes in sensor readings, indicating different conditions through LEDs and the serial output.

Portable Network Graphics (PNG) - 32.75 kB - 01/11/2024 at 19:20

Preview
Download

Code4.png

This code segment introduces a delay of 500 milliseconds (0.5 seconds) before performing a conditional check. If both the collision state (`collisionState`) and the load state (`loadState`) are HIGH, a victory message is displayed on the OLED screen. The text includes congratulations, identifying the player as "Arthur," and references elements such as "keyes" and "keyestudio." Finally, there is an additional delay of 250 milliseconds to allow the display to remain visible for a brief period.

Portable Network Graphics (PNG) - 23.60 kB - 01/11/2024 at 19:20

Preview
Download

Cables.jpg

We tried to make clean connections to avoid getting too confused.

JPEG Image - 135.76 kB - 01/11/2024 at 19:31

Preview
Download

ExternalDevice.PNG

During the international specialty, we had the opportunity to learn how to use new tools that could be beneficial in the future. These included the polystyrene cutter for engine support, the soldering iron for LEDs, and the glue gun, which proved useful in assembling various components at different stages.

Portable Network Graphics (PNG) - 75.67 kB - 01/12/2024 at 09:23

Preview
Download