26 April 2026

Team 5 - Fallout New Vegas Game Controller

 

Our controller is inspired by the retro futuristic, resource scarce world of Fallout: New Vegas. The wooden enclosure, exposed circuitry, and assembled components evoke a sense of improvised and scavenged technology aligning with the game’s post apocalyptic aesthetic. The conceptual model emphasizes embodied interaction, where players perform physical actions that mirror in game behaviors reinforcing the feeling of operating a rugged or makeshift device from within the Fallout universe.

The input to output mapping is designed to be clear and immersive. One large button is mapped to the “E” key for general use actions such as interacting with objects or confirming selections, while the second button is dedicated to shooting creating a strong and immediate combat input. A light sensor is used to open your Pip-boy, requiring players to manipulate environmental light like covering the sensor to press TAB. The motion sensor controls aiming, allowing players to physically tilt the controller to adjust their view. This creates a more natural and engaging targeting system. The potentiometer enables scrolling through menus or inventory offering smooth and continuous control. Additionally, a toggle switch is mapped to autorun, allowing players to maintain forward movement without continuous input.

Signifiers are embedded in the physical design: buttons suggest pressing the knob invites rotation and the switch clearly indicates a change in state. Feedback is both tactile and digital with physical clicks and resistance paired with immediate in game responses. Together, these relationships create strong affordances that connect directly to the themes of survival, resourcefulness, and interaction with worn but functional technology in Fallout: New Vegas.



#include <Mouse.h>
#include <Adafruit_CircuitPlayground.h>
#include <Keyboard.h>
// Threshold for potentiometer and light sensor for activation 
const int LIGHT_THRESHOLD = 30;
const int THRESHOLD = 20;
// Setup inputs
const int potPin = A4;
const int buttonPin = A7;
const int switchPin = A1;
const int a2ButtonPin = A2;

bool pressed = false;
bool lastSwitchState = HIGH;
bool mouseHeld = false;

void setup() {
  CircuitPlayground.begin();
  Keyboard.begin();
  Mouse.begin();

  Serial.begin(9600);

  pinMode(potPin, INPUT);
  pinMode(buttonPin, INPUT_PULLUP);
  pinMode(switchPin, INPUT_PULLUP);
  pinMode(a2ButtonPin, INPUT_PULLUP);
}

void loop() {

  //  Light  sensor → TAB 
 // Once the player covers enough of the light sensor input for TAB goes through
  if (CircuitPlayground.lightSensor() < LIGHT_THRESHOLD) {
    Keyboard.write(KEY_TAB);
    delay(250);
  }

  //  Motion → Mouse (Aim Controls) move the controller to move your characters view
  float x = CircuitPlayground.motionX();
  float y = CircuitPlayground.motionY();

  int moveX = 0;
  int moveY = 0;

  // X axis inverted
  if (x > 1.5) moveX = -5;
  else if (x < -1.5) moveX = 5;

  // Y stays normal
  if (y > 1.5) moveY = -5;
  else if (y < -1.5) moveY = 5;
  // 
  Mouse.move(moveX, moveY);

  //  Potentiometer controls the scrolling
  static int lastPotValue = 0;
  int potValue = analogRead(potPin);
  Serial.println(potValue);
 // Deadzone
  int deadzoneMin = 480;
  int deadzoneMax = 540;
  int scrollAmount = 0;

  if (potValue < deadzoneMin || potValue > deadzoneMax) {
    int diff = potValue - lastPotValue;
  // Speed of scroll
    if (abs(diff) > 10) {
      scrollAmount = diff / 50;
    }
  }

  if (scrollAmount != 0) {
    Mouse.move(0, 0, scrollAmount);
  }

  lastPotValue = potValue;

  //  Switch → Q Auto Walk is the key that turns on the auto walk
  bool currentSwitchState = digitalRead(switchPin);
 // Switch turning on and off
  if (currentSwitchState == LOW && lastSwitchState == HIGH) {
    Keyboard.press('q');
    delay(50);
    Keyboard.release('q');
  }

  lastSwitchState = currentSwitchState;

  //  Button → Mouse Hold player can just press the button to shoot 
  int buttonState = digitalRead(buttonPin);

  if (buttonState == LOW && !mouseHeld) {
    Mouse.press(MOUSE_LEFT);
    mouseHeld = true;
  }
  else if (buttonState == HIGH && mouseHeld) {
    Mouse.release(MOUSE_LEFT);
    mouseHeld = false;
  }

  //  A2 → E interact is on the other button press (easy access and easy input)
  bool a2State = digitalRead(a2ButtonPin);

  if (a2State == LOW && !pressed) {
    Keyboard.press('e');
    pressed = true;
  }
  else if (a2State == HIGH && pressed) {
    Keyboard.release('e');
    pressed = false;
  }

  delay(10);
}

No comments:

Post a Comment

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