Lunar Lander Controller
Objective:
Design and prototype a minimal and ergonomic controller for Lunar Lander online game.
Audience:
Anyone who wants to play the game on a personal computer (Me)
Components:
- Joystick breakout module
- Arduino Leonardo compatible pro micro board
- 3D printed case
Code:
#include <Keyboard.h> #include <Mouse.h> const int SW_pin = 4; // digital pin connected to switch output const int X_pin = 0; // analog pin connected to X output const int Y_pin = 1; // analog pin connected to Y output void setup() { pinMode(SW_pin, INPUT); digitalWrite(SW_pin, HIGH); Serial.begin(9600); Keyboard.begin(); Mouse.begin(); } void loop() { if(digitalRead(SW_pin)==0){ Mouse.press(MOUSE_LEFT); delay(0); } else if(analogRead(Y_pin)>=540){ Keyboard.press(218); delay(0); } else if(analogRead(X_pin)>=540){ Keyboard.press(215); delay(0); } else if(analogRead(X_pin)<=500){ Keyboard.press(216); delay(0); } else{ Keyboard.releaseAll(); Mouse.release(MOUSE_LEFT); } }
Initial prototype:
CAD:
Prototyping problem: 3D printers on the ITP floor didnt work, so tried fixing them, but turns out the nozzles were damaged or needed maintenance, so might take time to get it done.