Project Structure and Components:
Electronic Components:

Arduino Uno: Used to control the entire system, including joysticks, the shooting mechanism, LEDs, and sound effects.
Analog Joysticks: Each player uses a joystick to control their tank’s movement (forward, backward, left, right).
Motor: Used to launch the projectile (cardboard), triggered by a shooting button.
LEDs and Resistors: Indicate game statuses on the dashboard, such as shooting readiness, tank preparation, etc.
Buzzer or Speaker: For sound effects, such as shooting and explosions.
Wires and Connectors: To establish the electrical connections between components.
Physical Materials:

Cardboard: Primarily used for making the lightweight projectiles and the tank's structure.
Plastic (lightweight): Used for making the shooting mechanism and other tank parts that need to be sturdy yet lightweight.
Wood (optional): Used to reinforce the structure, particularly for the dashboard base or stands.
Additional Components: Buttons to activate game functions (shoot), screws, nuts, glue, and other mounting tools.
Project Progress:
December 11, 2024: Final Session
Joystick Improvements and Tank Controls:

The joysticks were calibrated to ensure smooth movement. Each joystick controls the tank’s movement (forward/backward on the Y-axis, left/right on the X-axis). Analog readings are sent to the Arduino, which translates this information to control the tank’s motors.
An Arduino code was written to handle these analog inputs, ensuring precise tank movement.
Prototyping and Shooting Mechanism:

A prototype for the shooting mechanism was finalized. It uses a small DC motor to propel a cardboard projectile when a button is pressed.
The mechanism was tested to ensure that the projectiles are launched with enough force but remain safe. The small motor ensures that the projectile is launched at a reasonable distance while keeping the game safe.
Arduino Code for Shooting Control: The code for managing the shooting with Arduino was enhanced, and the following logic was implemented:

Button Press Detection: When a button is pressed (e.g., a push-button type), a signal is sent to the Arduino to activate the motor and launch the projectile.
Motor Control Code:
cpp
Copier le code
const int joystickPinX = A0;
const int joystickPinY = A1;
const int shootButtonPin = 2;
const int motorPin = 3; // Connected to the motor that launches the projectile

void setup() {
  pinMode(shootButtonPin, INPUT);
  pinMode(motorPin, OUTPUT);
  Serial.begin(9600); // Start serial communication for debugging
}

void loop() {
  int joystickX = analogRead(joystickPinX); // Read the X position of the joystick
  int joystickY = analogRead(joystickPinY); // Read the Y position of the joystick
  bool shootButtonState = digitalRead(shootButtonPin); // Check if the shoot button is pressed
  
  // Tank movement controls
  if (joystickX > 512) {
    // Move right
    Serial.println("Moving Right");
  } else if (joystickX < 512) {
    // Move left
    Serial.println("Moving Left");
  }

  if (joystickY > 512) {
    // Move forward
    Serial.println("Moving Forward");
  } else if (joystickY < 512) {
    // Move backward
    Serial.println("Moving Backward");
  }

  // Shooting logic
  if (shootButtonState == HIGH) {
    digitalWrite(motorPin, HIGH);  // Activate the motor to launch the projectile
    delay(500);  // Shoot for 500ms
    digitalWrite(motorPin, LOW);   // Stop the motor
    Serial.println("Fired!");
  }
  
  delay(50); // Short delay to avoid overloading the loop
}
Dashboard Development:

The dashboard was equipped with LEDs to indicate game elements like shooting readiness or tank status. This visual system helps players know when they can shoot.
The Arduino code was adjusted to control the LEDs based on the game’s events.
December 3, 2024:
Tank Design and Assembly:
Physical components were finalized. The tank chassis was designed to be ergonomic and adjustable for different players. The joysticks and shooting mechanism are integrated into this chassis, and the dashboard is placed for easy access.
Shooting Mechanism:
Additional tests were conducted to ensure that the shooting mechanism worked properly. The cardboard projectiles were launched with enough force to reach a reasonable distance.
November 26, 2024:
Shooting Mechanism Finalization:

Adjustments were made to make the shooting mechanism more robust and ensure that the projectiles launched consistently. A more powerful motor was chosen to ensure the projectiles have enough force to be effectively launched.
LED Integration:

LEDs were soldered and integrated into the dashboard, and specific code was written to control their lighting based on the game state (e.g., when the tank is ready to shoot or when it is moving).
November 19, 2024:
Technical Problems and Solutions:
Adjustments were made to resolve an issue where the projectiles weren’t being launched. After testing multiple motors and improving the launch tube design, a more powerful motor was used to fix the issue.
November 5, 2024:
Initial Game Testing:
Initial tests of the game were conducted to ensure the joysticks and shooting mechanism functioned correctly. The basic code was written, and visual and audio effects (e.g., a buzzer for shooting) were implemented.
Progress and Next Steps:
Finalizing the Mechanical Assembly:

Optimize the shooting mechanism to ensure the system is reliable for extended gameplay sessions.
Improve the accuracy of the shooting by adjusting the motor and projectile launch tube.
Painting and Decorating the Tank:

Paint and decorate the tank chassis to give it a more attractive appearance, inspired by either military or Mario Kart-style tanks, depending on the project theme.
Adding Additional Features:

Integrate sound effects for shooting, explosions, and movement. Add more LEDs for additional visual effects.
Include an LCD screen to display additional information, such as the player’s score or the game’s status.
Testing and Final Validation:

Test the entire system with multiple users to ensure the game is smooth, fun, and functional.
Conclusion:
The project is progressing well, with key elements such as tank control, shooting mechanism, and the integration of visual and audio effects almost completed. The next steps will include finishing the physical components and adding additional details to enhance the overall gaming experience.