26 April 2026

Final Controller Team 23: golf it

 



Our project is a custom physical controller designed specifically for the game Golf It, with the goal of making the gameplay feel more intuitive, consistent, and thematically connected to real golf. The conceptual model behind our design is based on translating the game’s mouse‑based swing mechanic into a larger, more physical motion that resembles pulling back and swinging a golf club. Instead of relying on small, inconsistent mouse movements, our controller uses a large joystick connected to a potentiometer, allowing players to physically pull back and push forward to control swing strength. This creates a clearer mental model: the farther and faster you move the joystick, the stronger the hit—just like in real golf.

To reinforce the theme, we incorporated a real golf ball and designed the button as a golf tee. The top surface of the controller uses a textured material similar to golf turf, helping players immediately understand the purpose of the device through visual and tactile signifiers. When the player interacts with the joystick or presses the tee‑button, the controller provides direct feedback through on‑screen movement in the game. The potentiometer sends analog values through A2, mapping physical motion to vertical mouse movement, while the button on A1 tells the game that you are ready to swing. These mappings create clarity, pull back to aim power, tilt to aim direction, and press the tee to start swing.

Our design evolved from a small square base into a larger rectangular platform to give players more space for movement and to make the interaction more fun and immersive.

Team Contributions:  
Mathieu: Wiring, coding, input mapping, and controller mechanics
Kai: Physical design, theming, materials, and assembly

Peer Review Question:  
How effectively does our controller communicate its purpose and golf‑themed interactions to a first‑time player without explanation?





Code 


#include <Mouse.h>
#include <Adafruit_CircuitPlayground.h>

int potPin = A2;     // potentiometer
int buttonPin = A1;  // button on A1
int centerValue = 512;
int deadzone = 40;

void setup() {
  CircuitPlayground.begin();
  Mouse.begin();
  Serial.begin(9600);

  pinMode(buttonPin, INPUT_PULLUP);  // button to GND
}

void loop() {

  //  POTENTIOMETER  UP/DOWN WITH SAFE ZONE
  int potValue = analogRead(potPin);
  Serial.println(potValue);
  int diff = potValue - centerValue;

  if (abs(diff) > deadzone) {
    int moveY = diff / 5;
    Mouse.move(0, moveY, 0);
  }

  //  BOARD ROTATED SIDEWAYS  USE motionY FOR LEFT/RIGHT
  float tiltY = CircuitPlayground.motionY();  // up/down tilt
  int moveX = tiltY * 2;                      // convert to left/right
  Mouse.move(moveX, 0, 0);

  // BUTTON  LEFT CLICK 
  static bool buttonWasPressed = false;
  bool buttonPressed = (digitalRead(buttonPin) == LOW);

  if (buttonPressed && !buttonWasPressed) {
    Mouse.click();
    delay(150);
  }

  buttonWasPressed = buttonPressed;

  delay(10);
}








No comments:

Post a Comment

Note: Only a member of this blog may post a comment.