Close

encountering problems

A project log for FPS alt controller

Alternative controller with a gun and joystick for FPS games

shrey-modyShrey Mody 12/16/2024 at 20:110 Comments

Our idea is to emulate the keys of a keyboard from buttons that are controlled by arduino. Problem is that it writing wtihout any input and deletes the codes. Here is the code:

#include <Keyboard.h>
#include <Mouse.h>

void setup() {
  Keyboard.begin();

  pinMode(8, INPUT);
  pinMode(7, INPUT);
  pinMode(6, INPUT);
  Mouse.begin();
}

void loop() {
  if (digitalRead(8) == HIGH) {
    Keyboard.press('w');
    Keyboard.releaseAll();
    delay(10);
  }

  if (digitalRead(7) ==HIGH ) {
    Keyboard.press('s');
    Keyboard.releaseAll();
    delay(10);
  }

  if (digitalRead(6) == HIGH) {
    Mouse.click();
    delay(10);
  }
}

We have also 3D printed the first prototype of our gun, which will store all of the buttons.

Doesn't look good but we have v2 on the way because the upperpart was too small

Discussions